| java.lang.Object org.apache.xerces.readers.XMLCatalogHandler
All known Subclasses: org.apache.xerces.readers.XCatalog,
XMLCatalogHandler | abstract public class XMLCatalogHandler implements EntityResolver(Code) | | 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.
author: Andy Clark, IBM See Also: org.xml.sax.EntityResolver |
addPublicMapping | public void addPublicMapping(String publicId, String systemId)(Code) | | Adds a public to system identifier mapping.
Parameters: publicId - The public identifier, or "key". Parameters: systemId - The system identifier, or "value". |
addSystemMapping | public void addSystemMapping(String systemId1, String systemId2)(Code) | | Adds a system identifier alias.
Parameters: publicId - The system identifier "key". Parameters: systemId - The system identifier "value". |
getPublicMapping | public String getPublicMapping(String publicId)(Code) | | Returns a public identifier mapping.
Parameters: publicId - The public identifier, or "key". Returns the system identifier value or null if thereis no mapping defined. |
getPublicMappingKeys | public Enumeration getPublicMappingKeys()(Code) | | Returns an enumeration of public identifier mapping keys.
|
getSystemMapping | public String getSystemMapping(String systemId)(Code) | | Returns a system identifier alias.
Parameters: systemId - The system identifier "key". Returns the system identifier alias value or null if thereis no alias defined. |
getSystemMappingKeys | public Enumeration getSystemMappingKeys()(Code) | | Returns an enumeration of system identifier mapping keys.
|
loadCatalog | abstract public void loadCatalog(InputSource source) throws Exception(Code) | | Loads the catalog stream specified by the given input source and
appends the contents to the catalog.
Parameters: source - The catalog source. exception: java.lang.Exception - Throws an exception if an erroroccurs while loading the catalog source. |
removePublicMapping | public void removePublicMapping(System publicId)(Code) | | Removes a public identifier mapping.
Parameters: publicId - The public identifier to remove. |
removeSystemMapping | public void removeSystemMapping(String systemId)(Code) | | Removes a system identifier alias.
Parameters: systemId - The system identifier to remove. |
resolveEntity | public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException(Code) | | Resolves external entities.
Parameters: publicId - The public identifier used for entity resolution. Parameters: systemId - If the publicId is not null, this systemId isto be considered the default system identifier;else a system identifier alias mapping isrequested. Returns the input source of the resolved entity or nullif no resolution is possible. exception: org.xml.sax.SAXException - Exception thrown on SAX error. exception: java.io.IOException - Exception thrown on i/o error. |
|
|