| java.lang.Object org.jaffa.util.DefaultEntityResolver
DefaultEntityResolver | public class DefaultEntityResolver implements EntityResolver(Code) | | This is an implementation of the EntityResolver interface.
It maintains a map of PublicId/DtdUrlString pairs, which are loaded from the org/jaffa/config/dtd.properties file.
An instance of this class should be passed to the XML parser, before parsing an XML file.
This will ensure that the parser reads the DTD file off the local machine (if specifed by the publicId) or uses the systemId to locate the DTD on an external resource.
author: GautamJ |
Method Summary | |
public InputSource | resolveEntity(String publicId, String systemId) This method will be invoked by an XML parser, when it tries to locate the DTD for validating the XML.
If the publicId is passed and the internal Map of PublicId/DtdUrlString pairs contains an entry for it, then an InputStream object will be created for the corresponding DTD.
This is useful for cases where the DTD is located locally on the web-server, and hence doesn't need to access any external resource for locating DTDs.
A null will be returned, in case there is no entry for the publicId in the internal Map.
In such a case, the parser will locate the DTD as specified by the systemId.
Parameters: publicId - The public identifier of the external entity being referenced, or null if none was supplied. Parameters: systemId - The system identifier of the external entity being referenced. |
resolveEntity | public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException(Code) | | This method will be invoked by an XML parser, when it tries to locate the DTD for validating the XML.
If the publicId is passed and the internal Map of PublicId/DtdUrlString pairs contains an entry for it, then an InputStream object will be created for the corresponding DTD.
This is useful for cases where the DTD is located locally on the web-server, and hence doesn't need to access any external resource for locating DTDs.
A null will be returned, in case there is no entry for the publicId in the internal Map.
In such a case, the parser will locate the DTD as specified by the systemId.
Parameters: publicId - The public identifier of the external entity being referenced, or null if none was supplied. Parameters: systemId - The system identifier of the external entity being referenced. 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. throws: IOException - A Java-specific IO exception, possibly the result of creating a new InputStream or Reader for the InputSource. |
|
|