Top Description Fields Constructors Methods
org.apache.xerces.util

public Class EntityResolver2Wrapper

extends Object
implements ExternalSubsetResolver
Class Inheritance
All Implemented Interfaces
org.apache.xerces.impl.ExternalSubsetResolver, org.apache.xerces.xni.parser.XMLEntityResolver
Imports
java.io.IOException, .InputStream, .Reader, org.apache.xerces.impl.ExternalSubsetResolver, .XMLEntityDescription, org.apache.xerces.xni.XMLResourceIdentifier, .XNIException, org.apache.xerces.xni.grammars.XMLDTDDescription, org.apache.xerces.xni.parser.XMLInputSource, org.xml.sax.InputSource, .SAXException, org.xml.sax.ext.EntityResolver2

This class wraps a SAX entity resolver (EntityResolver2) in an XNI entity resolver.

Author
Michael Glavassevich, IBM
Version
$Id: EntityResolver2Wrapper.java 699892 2008-09-28 21:08:27Z mrglavas $

Field Summary

Modifier and TypeField and Description
protected EntityResolver2
fEntityResolver

An instance of SAX2 Extensions 1.1's EntityResolver2.

Constructor Summary

AccessConstructor and Description
public
EntityResolver2Wrapper()

Default constructor.

public
EntityResolver2Wrapper(EntityResolver2
the SAX entity resolver to wrap
entityResolver
)

Creates a new instance wrapping the given SAX entity resolver.

Method Summary

Modifier and TypeMethod and Description
private XMLInputSource
createXMLInputSource(InputSource source, String baseURI)

Creates an XMLInputSource from a SAX InputSource.

public EntityResolver2

Returns:

the SAX entity resolver wrapped by this object
getEntityResolver
()

Returns the SAX entity resolver wrapped by this object.

public XMLInputSource
getExternalSubset(XMLDTDDescription
a description of the DTD
grammarDescription
)

Implements org.apache.xerces.impl.ExternalSubsetResolver.getExternalSubset.

Locates an external subset for documents which do not explicitly provide one.

public XMLInputSource
resolveEntity(XMLResourceIdentifier
contains the physical co-ordinates of the resource to be resolved
resourceIdentifier
)

Implements org.apache.xerces.xni.parser.XMLEntityResolver.resolveEntity.

Resolves an external parsed entity.
public void
setEntityResolver(EntityResolver2
the SAX entity resolver to wrap
entityResolver
)

Sets the SAX entity resolver wrapped by this object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fEntityResolverback to summary
protected EntityResolver2 fEntityResolver

An instance of SAX2 Extensions 1.1's EntityResolver2.

Constructor Detail

EntityResolver2Wrapperback to summary
public EntityResolver2Wrapper()

Default constructor.

EntityResolver2Wrapperback to summary
public EntityResolver2Wrapper(EntityResolver2 entityResolver)

Creates a new instance wrapping the given SAX entity resolver.

Parameters
entityResolver:EntityResolver2

the SAX entity resolver to wrap

Method Detail

createXMLInputSourceback to summary
private XMLInputSource createXMLInputSource(InputSource source, String baseURI)

Creates an XMLInputSource from a SAX InputSource.

getEntityResolverback to summary
public EntityResolver2 getEntityResolver()

Returns the SAX entity resolver wrapped by this object.

Returns:EntityResolver2

the SAX entity resolver wrapped by this object

getExternalSubsetback to summary
public XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription) throws XNIException, IOException

Implements org.apache.xerces.impl.ExternalSubsetResolver.getExternalSubset.

Locates an external subset for documents which do not explicitly provide one. If no external subset is provided, this method should return null.

Parameters
grammarDescription:XMLDTDDescription

a description of the DTD

Exceptions
XNIException:
Thrown on general error.
IOException:
Thrown if resolved entity stream cannot be opened or some other i/o error occurs.
resolveEntityback to summary
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException

Implements org.apache.xerces.xni.parser.XMLEntityResolver.resolveEntity.

Resolves an external parsed entity. If the entity cannot be resolved, this method should return null.

Parameters
resourceIdentifier:XMLResourceIdentifier

contains the physical co-ordinates of the resource to be resolved

Exceptions
XNIException:
Thrown on general error.
IOException:
Thrown if resolved entity stream cannot be opened or some other i/o error occurs.
setEntityResolverback to summary
public void setEntityResolver(EntityResolver2 entityResolver)

Sets the SAX entity resolver wrapped by this object.

Parameters
entityResolver:EntityResolver2

the SAX entity resolver to wrap