org.apache.xerces.util
Class EntityResolver2Wrapper

java.lang.Object
  extended by org.apache.xerces.util.EntityResolver2Wrapper
All Implemented Interfaces:
ExternalSubsetResolver, XMLEntityResolver

public class EntityResolver2Wrapper
extends java.lang.Object
implements ExternalSubsetResolver

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

Version:
$Id: EntityResolver2Wrapper.java 447241 2006-09-18 05:12:57Z mrglavas $
Author:
Michael Glavassevich, IBM

Constructor Summary
EntityResolver2Wrapper()
          Default constructor.
EntityResolver2Wrapper(EntityResolver2 entityResolver)
          Creates a new instance wrapping the given SAX entity resolver.
 
Method Summary
 EntityResolver2 getEntityResolver()
          Returns the SAX entity resolver wrapped by this object.
 XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription)
          Locates an external subset for documents which do not explicitly provide one.
 XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
          Resolves an external parsed entity.
 void setEntityResolver(EntityResolver2 entityResolver)
          Sets the SAX entity resolver wrapped by this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityResolver2Wrapper

public EntityResolver2Wrapper()
Default constructor.


EntityResolver2Wrapper

public EntityResolver2Wrapper(EntityResolver2 entityResolver)

Creates a new instance wrapping the given SAX entity resolver.

Parameters:
entityResolver - the SAX entity resolver to wrap
Method Detail

setEntityResolver

public void setEntityResolver(EntityResolver2 entityResolver)

Sets the SAX entity resolver wrapped by this object.

Parameters:
entityResolver - the SAX entity resolver to wrap

getEntityResolver

public EntityResolver2 getEntityResolver()

Returns the SAX entity resolver wrapped by this object.

Returns:
the SAX entity resolver wrapped by this object

getExternalSubset

public XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription)
                                 throws XNIException,
                                        java.io.IOException

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

Specified by:
getExternalSubset in interface ExternalSubsetResolver
Parameters:
grammarDescription - a description of the DTD
Throws:
XNIException - Thrown on general error.
java.io.IOException - Thrown if resolved entity stream cannot be opened or some other i/o error occurs.

resolveEntity

public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
                             throws XNIException,
                                    java.io.IOException
Resolves an external parsed entity. If the entity cannot be resolved, this method should return null.

Specified by:
resolveEntity in interface XMLEntityResolver
Parameters:
resourceIdentifier - contains the physical co-ordinates of the resource to be resolved
Throws:
XNIException - Thrown on general error.
java.io.IOException - Thrown if resolved entity stream cannot be opened or some other i/o error occurs.
See Also:
XMLResourceIdentifier