|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.readers.XMLCatalogHandler
Interface for implementing basic catalog support in the parser. To implement and use a Catalog, implement this interface and install your catalog instance as the EntityResolver in the parser's entity handler. For example:
XMLParser parser = new AnyParser(); parser.addCatalogHandler(new MyCatalog());
This default catalog implementation does not provide a method for loading multiple catalogs from various input sources. Instead, it is a convenient base class for other catalog implementations.
To create a catalog implementation, simply extend this class and implement the loadCatalog method. Public and system identifier mappings can be stored and accessed using the convenient public methods on this class.
EntityResolver
Constructor Summary | |
---|---|
XMLCatalogHandler()
|
Method Summary | |
---|---|
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.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. |
abstract void |
loadCatalog(InputSource source)
Loads the catalog stream specified by the given input source and appends the contents to the catalog. |
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)
Resolves external entities. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLCatalogHandler()
Method Detail |
public abstract void loadCatalog(InputSource source) throws java.lang.Exception
source
- The catalog source.java.lang.Exception
- Throws an exception if an error
occurs while loading the catalog source.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)
publicId
- The system identifier "key".systemId
- The system identifier "value".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 InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws SAXException, java.io.IOException
resolveEntity
in interface EntityResolver
publicId
- The public identifier used for entity resolution.systemId
- If the publicId is not null, this systemId is
to be considered the default system identifier;
else a system identifier alias mapping is
requested.SAXException
- Exception thrown on SAX error.java.io.IOException
- Exception thrown on i/o error.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |