| java.lang.Object org.apache.xerces.framework.XMLDTDScanner
All known Subclasses: org.apache.xerces.validators.dtd.DTDGrammar,
XMLDTDScanner | final public class XMLDTDScanner (Code) | | Default implementation of an XML DTD scanner.
Clients who wish to scan a DTD should implement
XMLDTDScanner.EventHandler to provide the desired behavior
when various DTD components are encountered.
To process the DTD, the client application should follow the
following sequence:
- call scanDocTypeDecl() to scan the DOCTYPE declaration
- call getReadingExternalEntity() to determine if scanDocTypeDecl found an
external subset
- if scanning an external subset, call scanDecls(true) to process the external subset
See Also: XMLDTDScanner.EventHandler version: $Id: XMLDTDScanner.java,v 1.19 2001/04/26 17:45:50 lmartin Exp $ |
Inner Class :public interface EventHandler | |
Method Summary | |
public void | checkForAttributeNameWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastchar, QName attribute) | public void | checkForElementTypeWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastchar, QName element) | public int | checkForNameWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastcheck) | public int | checkForNmtokenWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastcheck) | public void | endOfInput(int entityNameIndex, boolean moreToFollow) | public boolean | getReadingContentSpec() | public boolean | getReadingExternalEntity() | public int | markupDepth() Report the markup nesting depth. | public int | normalizeDefaultAttValue(QName attribute, int defaultAttValue, int attType, int enumeration, boolean list) | public int | parenDepth() Report the parenthesis nesting depth. | public void | readerChange(XMLEntityHandler.EntityReader nextReader, int nextReaderId) | protected void | reportRecoverableXMLError(int majorCode, int minorCode, int stringIndex1) Report a recoverable xml error. | protected void | reportRecoverableXMLError(int majorCode, int minorCode, String string1) Report a recoverable xml error. | protected void | reportRecoverableXMLError(int majorCode, int minorCode, String string1, String string2) Report a recoverable xml error. | public void | reset(StringPool stringPool, XMLEntityHandler.CharBuffer literalData) Allow XMLDTDScanner to be reused. | public void | scanDecls(boolean extSubset) | public int | scanDefaultAttValue(QName element, QName attribute) | public int | scanDefaultAttValue(QName element, QName attribute, int attType, int enumeration) | public boolean | scanDoctypeDecl() This routine is called after the <!DOCTYPE portion of a DOCTYPE
line has been called. | public void | setDTDHandler(XMLDocumentHandler.DTDHandler dtdHandler) Set the DTD handler. | public void | setEventHandler(XMLDTDScanner.EventHandler eventHandler) | public void | setGrammarResolver(GrammarResolver resolver) Sets the grammar resolver. | public void | setLoadExternalDTD(boolean enabled) Sets whether the parser loads the external DTD. | public void | setNamespacesEnabled(boolean enabled) | public void | setValidationEnabled(boolean enabled) |
endOfInput | public void endOfInput(int entityNameIndex, boolean moreToFollow) throws Exception(Code) | | Handle the end of input
Parameters: entityName - the handle in the string pool of the name of the entity which has reached end of input Parameters: moreToFollow - if true, there is still input left to process in other readers exception: java.lang.Exception - |
getReadingContentSpec | public boolean getReadingContentSpec()(Code) | | Is the scanner reading a ContentSpec?
true if the scanner is reading a ContentSpec |
getReadingExternalEntity | public boolean getReadingExternalEntity()(Code) | | Is the XMLDTDScanner reading from an external entity?
This will be true, in particular if there was an external subset
true if the XMLDTDScanner is reading from an external entity. |
markupDepth | public int markupDepth()(Code) | | Report the markup nesting depth. This allows a client to
perform validation checks for correct markup nesting. This keeps
scanning and validation separate.
the markup nesting depth |
normalizeDefaultAttValue | public int normalizeDefaultAttValue(QName attribute, int defaultAttValue, int attType, int enumeration, boolean list) throws Exception(Code) | | |
parenDepth | public int parenDepth()(Code) | | Report the parenthesis nesting depth. This allows a client to
perform validation checks for correct parenthesis balancing. This keeps
scanning and validation separate.
the parenthesis depth |
readerChange | public void readerChange(XMLEntityHandler.EntityReader nextReader, int nextReaderId) throws Exception(Code) | | Change readers
Parameters: nextReader - the new reader that the scanner will use Parameters: nextReaderId - id of the reader to change to throws java.lang.Exception |
reportRecoverableXMLError | protected void reportRecoverableXMLError(int majorCode, int minorCode, int stringIndex1) throws Exception(Code) | | Report a recoverable xml error.
|
reportRecoverableXMLError | protected void reportRecoverableXMLError(int majorCode, int minorCode, String string1) throws Exception(Code) | | Report a recoverable xml error.
|
reportRecoverableXMLError | protected void reportRecoverableXMLError(int majorCode, int minorCode, String string1, String string2) throws Exception(Code) | | Report a recoverable xml error.
|
reset | public void reset(StringPool stringPool, XMLEntityHandler.CharBuffer literalData) throws Exception(Code) | | Allow XMLDTDScanner to be reused. This method is called from an
XMLParser reset method, which passes the StringPool to be used
by the reset DTD scanner instance.
Parameters: stringPool - the string pool to be used by XMLDTDScanner. |
scanDecls | public void scanDecls(boolean extSubset) throws Exception(Code) | | Scan markup declarations
Parameters: extSubset - true if the scanner is scanning an external subset, falseif it is scanning an internal subset exception: java.lang.Exception - |
scanDefaultAttValue | public int scanDefaultAttValue(QName element, QName attribute) throws Exception(Code) | | Scan the default value in an attribute declaration
Parameters: elementType - handle to the element that owns the attribute Parameters: attrName - handle in the string pool for the attribute name handle in the string pool for the default attribute value exception: java.lang.Exception - |
scanDefaultAttValue | public int scanDefaultAttValue(QName element, QName attribute, int attType, int enumeration) throws Exception(Code) | | |
scanDoctypeDecl | public boolean scanDoctypeDecl() throws Exception(Code) | | This routine is called after the <!DOCTYPE portion of a DOCTYPE
line has been called. scanDocTypeDecl goes onto scan the rest of the DOCTYPE
decl. If an internal DTD subset exists, it is scanned. If an external DTD
subset exists, scanDocTypeDecl sets up the state necessary to process it.
true if successful exception: java.lang.Exception - |
setEventHandler | public void setEventHandler(XMLDTDScanner.EventHandler eventHandler)(Code) | | Set the event handler
Parameters: eventHandler - The place to send our callbacks. |
setGrammarResolver | public void setGrammarResolver(GrammarResolver resolver)(Code) | | Sets the grammar resolver.
|
setLoadExternalDTD | public void setLoadExternalDTD(boolean enabled)(Code) | | Sets whether the parser loads the external DTD.
|
setNamespacesEnabled | public void setNamespacesEnabled(boolean enabled)(Code) | | set fNamespacesEnabled *
|
setValidationEnabled | public void setValidationEnabled(boolean enabled)(Code) | | set fValidationEnabled *
|
|
|