Package com.verisign.epp.util
Class EPPSchemaCachingEntityResolver
java.lang.Object
com.verisign.epp.util.EPPSchemaCachingEntityResolver
- All Implemented Interfaces:
org.apache.xerces.xni.parser.XMLEntityResolver,EntityResolver
public class EPPSchemaCachingEntityResolver
extends Object
implements org.apache.xerces.xni.parser.XMLEntityResolver, EntityResolver
EPPSchemaCachingEntityResolver is the entity resolver that goes with
EPPSchemaCachingParser. It supports caching schemas for the parser instance
and looking up schema instances in the Classpath.
-
Constructor Summary
ConstructorsConstructorDescriptionEPPSchemaCachingEntityResolver(EPPSchemaCacher aSchemaCache) Create a new instance of EPPSchemaCachingEntityResolver. -
Method Summary
Modifier and TypeMethodDescriptionresolveEntity(String aPublicId, String aSystemId) Resolves the entity passed in when parsing the instance document.org.apache.xerces.xni.parser.XMLInputSourceresolveEntity(org.apache.xerces.xni.XMLResourceIdentifier aResourceIdentifier) Implemented because of the XNI interface.
-
Constructor Details
-
EPPSchemaCachingEntityResolver
Create a new instance of EPPSchemaCachingEntityResolver. Resolves XML Schemas by looking them up in the classpath. As a param takes an instance of EPPSchemaCacher to call back on to cache a schema once it loads it.- Parameters:
aSchemaCache- An instance of EPPSchemaCacher to call back on to cache a schema once it loads it.
-
-
Method Details
-
resolveEntity
public InputSource resolveEntity(String aPublicId, String aSystemId) throws SAXException, IOException Resolves the entity passed in when parsing the instance document. Will try to find the schema from the classpath.- Specified by:
resolveEntityin interfaceEntityResolver- Parameters:
aPublicId- Public identifier of entityaSystemId- System identifier of entity- Returns:
- XML schema associated with the entity
- Throws:
SAXException- Error locating the XML schemaIOException- Other errororg.apache.xerces.xni.XNIException- Error parsing the XML schema
-
resolveEntity
public org.apache.xerces.xni.parser.XMLInputSource resolveEntity(org.apache.xerces.xni.XMLResourceIdentifier aResourceIdentifier) throws org.apache.xerces.xni.XNIException, IOException Implemented because of the XNI interface. The entity resolver tries to find the resource in the classpath. This interface imlementation allows this resolver to be used as either the standard EntityResolver or one that can be used by the Xerces XNI components. If the resource can't be found an exception is thrown- Specified by:
resolveEntityin interfaceorg.apache.xerces.xni.parser.XMLEntityResolver- Parameters:
aResourceIdentifier- The resource identifier that should be resolved.- Returns:
- The XMLInputSource of the resource if found. Never returns null.
- Throws:
org.apache.xerces.xni.XNIException- Error resolving name instanceIOException- Error loading XML schema
-