Package net.n3.nanoxml
Class XMLEntityResolver
java.lang.Object
net.n3.nanoxml.XMLEntityResolver
- All Implemented Interfaces:
IXMLEntityResolver
- Direct Known Subclasses:
SAXEntityResolver
An XMLEntityResolver resolves entities.
- Version:
- $Name: RELEASE_2_2_1 $, $Revision: 1.4 $
- Author:
- Marc De Scheemaecker
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalEntity(String name, String publicID, String systemID) Adds an external entity.voidaddInternalEntity(String name, String value) Adds an internal entity.protected voidfinalize()Cleans up the object when it's destroyed.getEntity(IXMLReader xmlReader, String name) Returns a Java reader containing the value of an entity.booleanisExternalEntity(String name) Returns true if an entity is external.protected ReaderopenExternalEntity(IXMLReader xmlReader, String publicID, String systemID) Opens an external entity.
-
Constructor Details
-
XMLEntityResolver
public XMLEntityResolver()Initializes the resolver.
-
-
Method Details
-
finalize
Cleans up the object when it's destroyed. -
addInternalEntity
Adds an internal entity.- Specified by:
addInternalEntityin interfaceIXMLEntityResolver- Parameters:
name- the name of the entity.value- the value of the entity.
-
addExternalEntity
Adds an external entity.- Specified by:
addExternalEntityin interfaceIXMLEntityResolver- Parameters:
name- the name of the entity.publicID- the public ID of the entity, which may be null.systemID- the system ID of the entity.
-
getEntity
Returns a Java reader containing the value of an entity.- Specified by:
getEntityin interfaceIXMLEntityResolver- Parameters:
xmlReader- the current XML readername- the name of the entity.- Returns:
- the reader, or null if the entity could not be resolved.
- Throws:
XMLParseException- If an exception occurred while resolving the entity.
-
isExternalEntity
Returns true if an entity is external.- Specified by:
isExternalEntityin interfaceIXMLEntityResolver- Parameters:
name- the name of the entity.
-
openExternalEntity
protected Reader openExternalEntity(IXMLReader xmlReader, String publicID, String systemID) throws XMLParseException Opens an external entity.- Parameters:
xmlReader- the current XML readerpublicID- the public ID, which may be nullsystemID- the system ID- Returns:
- the reader, or null if the reader could not be created/opened
- Throws:
XMLParseException
-