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 Details

    • EPPSchemaCachingEntityResolver

      public EPPSchemaCachingEntityResolver(EPPSchemaCacher aSchemaCache)
      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:
      resolveEntity in interface EntityResolver
      Parameters:
      aPublicId - Public identifier of entity
      aSystemId - System identifier of entity
      Returns:
      XML schema associated with the entity
      Throws:
      SAXException - Error locating the XML schema
      IOException - Other error
      org.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:
      resolveEntity in interface org.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 instance
      IOException - Error loading XML schema