org.jpos.iso.packager
Class GenericPackager.GenericEntityResolver

java.lang.Object
  extended by org.jpos.iso.packager.GenericPackager.GenericEntityResolver
All Implemented Interfaces:
EntityResolver
Enclosing class:
GenericPackager

public class GenericPackager.GenericEntityResolver
extends Object
implements EntityResolver


Constructor Summary
GenericPackager.GenericEntityResolver()
           
 
Method Summary
 InputSource resolveEntity(String publicId, String systemId)
          Allow the application to resolve external entities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericPackager.GenericEntityResolver

public GenericPackager.GenericEntityResolver()
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException,
                                 IOException
Allow the application to resolve external entities.

The strategy we follow is:

We first check whether the DTD points to a well defined URI, and resolve to our internal DTDs.

If the systemId points to a file, then we attempt to read the DTD from the filesystem, in case they've been modified by the user. Otherwise, we fallback to the built-in DTDs inside jPOS.

Specified by:
resolveEntity in interface EntityResolver
Parameters:
publicId - The public identifier of the external entity being referenced, or null if none was supplied.
systemId - The system identifier of the external entity being referenced.
Returns:
An InputSource object describing the new input source, or null to request that the parser open a regular URI connection to the system identifier.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
IOException - A Java-specific IO exception, possibly the result of creating a new InputStream or Reader for the InputSource.
See Also:
InputSource


Copyright © 1998-2012 jPOS.org. All Rights Reserved.