|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.xml.io.XMLEntityResolver
A flexable entity resolver for use with parsing XML files. This implements:
A list of class loaders maybe associated with this object. If so
an attempt will be made to resolve file:
URLs from
the class path.
XCatalog
Field Summary | |
static java.lang.String |
CLASSPATH_PROTOCOL
Protocol to use in specifying a URL pointing to the CLASSPATH. |
static java.lang.String |
CLASSPATH_PROTOCOL_PREFIX
Protocol prefix. |
static java.lang.String |
DEFAULT_ENTITY_CATALOG
URL for Enhydra default entity catalog. |
static java.lang.String |
LUTRIS_ENTITY_CATALOG
URL for Lutrus Enhydra default entity catalog. |
Constructor Summary | |
XMLEntityResolver()
|
Method Summary | |
void |
addClassLoader(java.lang.ClassLoader classLoader)
Add a classloader to the end of the order list of classloaders to search for entities. |
void |
addPublicMapping(java.lang.String publicId,
java.lang.String systemId)
Adds a public to system identifier mapping. |
void |
addSystemMapping(java.lang.String systemId1,
java.lang.String systemId2)
Adds a system identifier alias. |
java.util.Enumeration |
getClassLoaders()
Get an enumeration of the class loaders. |
java.io.PrintWriter |
getDebugWriter()
Get the debug writer. |
java.lang.String |
getPublicMapping(java.lang.String publicId)
Returns a public identifier mapping. |
java.util.Enumeration |
getPublicMappingKeys()
Returns an enumeration of public identifier mapping keys. |
java.lang.String |
getSystemMapping(java.lang.String systemId)
Returns a system identifier alias. |
java.util.Enumeration |
getSystemMappingKeys()
Returns an enumeration of system identifier mapping keys. |
void |
loadCatalog(InputSource source)
Loads a catalog specified by the given input source and appends the contents to the catalog object. |
void |
removePublicMapping(java.lang.System publicId)
Removes a public identifier mapping. |
void |
removeSystemMapping(java.lang.String systemId)
Removes a system identifier alias. |
InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Allow the application to resolve external entities. |
void |
setDebugWriter(java.io.PrintWriter writer)
Set a writer used to output debug messages. |
void |
setDefaultResolving()
Load the default entity catalog and enable loading entities the classloader for the classloader that loaded this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CLASSPATH_PROTOCOL
public static final java.lang.String CLASSPATH_PROTOCOL_PREFIX
public static final java.lang.String DEFAULT_ENTITY_CATALOG
#loadDefaultCatalog
,
Constant Field Valuespublic static final java.lang.String LUTRIS_ENTITY_CATALOG
#loadDefaultCatalog
,
Constant Field ValuesConstructor Detail |
public XMLEntityResolver()
Method Detail |
public void setDebugWriter(java.io.PrintWriter writer)
public java.io.PrintWriter getDebugWriter()
public void loadCatalog(InputSource source) throws SAXException, java.io.IOException
source
- The catalog source.
SAXException
- Throws exception on SAX error.
java.io.IOException
- Throws exception on i/o error.public void setDefaultResolving() throws SAXException, java.io.IOException
SAXException
java.io.IOException
public void addPublicMapping(java.lang.String publicId, java.lang.String systemId)
publicId
- The public identifier, or "key".systemId
- The system identifier, or "value".public void removePublicMapping(java.lang.System publicId)
publicId
- The public identifier to remove.public java.util.Enumeration getPublicMappingKeys()
public java.lang.String getPublicMapping(java.lang.String publicId)
publicId
- The public identifier, or "key".
public void addSystemMapping(java.lang.String systemId1, java.lang.String systemId2)
public void removeSystemMapping(java.lang.String systemId)
systemId
- The system identifier to remove.public java.util.Enumeration getSystemMappingKeys()
public java.lang.String getSystemMapping(java.lang.String systemId)
systemId
- The system identifier "key".
public void addClassLoader(java.lang.ClassLoader classLoader)
public java.util.Enumeration getClassLoaders()
public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws SAXException, java.io.IOException
EntityResolver
The Parser will call this method before opening any external entity except the top-level document entity (including the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element): the application may request that the parser resolve the entity itself, that it use an alternative URI, or that it use an entirely different input source.
Application writers can use this method to redirect external system identifiers to secure and/or local URIs, to look up public identifiers in a catalogue, or to read an entity from a database or other input source (including, for example, a dialog box).
If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to the application.
resolveEntity
in interface EntityResolver
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.
java.io.IOException
- A Java-specific IO exception,
possibly the result of creating a new InputStream
or Reader for the InputSource.
SAXException
- Any SAX exception, possibly
wrapping another exception.EntityResolver
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |