|
XML for Java 2.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface used for entity events.
XMLParser
Method Summary | |
void |
addRecognizer(XMLDeclRecognizer recognizer)
Adds a recognizer. |
XMLReader |
createReader(InputSource source,
boolean xmlDecl)
Creates a parser reader object from the given input source. |
void |
endInputSource(InputSource inputSource)
End of an input source. |
int |
expandSystemId(int systemId)
Fully expands a given system identified. |
EntityResolver |
getEntityResolver()
Returns the resolver used to resolve external entities. |
void |
reset(ParserState parserState)
Resets the entity handler, usually in response to a new call to XMLParser.parse. |
InputSource |
resolveEntity(int publicId,
int systemId)
Performs the entity resolution. |
void |
setEntityResolver(EntityResolver resolver)
Sets the resolver used to resolve external entities. |
void |
startInputSource(InputSource inputSource)
Start of an input source. |
Method Detail |
public void reset(ParserState parserState)
parserState
- The parser state.public void addRecognizer(XMLDeclRecognizer recognizer)
recognizer
- The XML recognizer to add.public void setEntityResolver(EntityResolver resolver)
resolver
- The new entity resolver. Passing a null value will
uninstall the currently installed resolver.Catalog
,
XMLParser.loadCatalog(org.xml.sax.InputSource)
public EntityResolver getEntityResolver()
setEntityResolver(org.xml.sax.EntityResolver)
public InputSource resolveEntity(int publicId, int systemId) throws java.lang.Exception
publidId
- The index of the public identifier string in the
parser StringPool. If this value is -1, then a
system identifier alias is requested; else the
system identifier represents the default entity
resolution if no public identifier mapping is
possible.systemId
- The index of the system identifier string in the
parser StringPool.getEntityResolver()
,
StringPool.toString(int)
public int expandSystemId(int systemId)
The following method expands a system identifier given as a java.lang.String.
public String expandSystemId(XMLParser parser, String systemId) throws Exception { StringPool pool = parser.getParserState().getStringPool(); // expand entity int oldIndex = pool.addString(systemId); int newIndex = parser.getEntityHandler().expandSystemId(oldIndex); systemId = pool.toIndex(newIndex); // release string pool resources pool.releaseString(oldIndex); pool.releaseString(newIndex); // return expanded system id return systemId; }
systemId
- The index of the system identifier string in the
parser StringPool.StringPool.toString(int)
public XMLReader createReader(InputSource source, boolean xmlDecl) throws java.lang.Exception
This is the point in the default implementation where relative system identifiers are expanded. For example, if the current source URI is "http://host/path/file.xml" and the specified input source system identifier is "dtd/file.dtd", then the system identifier, if not already opened, will be set to "http://host/path/dtd/file.dtd".
source
- The input source.xmlDecl
- True if the source represents an XML decl.public void startInputSource(InputSource inputSource)
inputSource
- The input source that is starting.public void endInputSource(InputSource inputSource)
inputSource
- The input source that is ended.
|
XML for Java 2.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |