|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.framework.XMLDTDScanner
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:
XMLDTDScanner.EventHandler
Inner Class Summary | |
static interface |
XMLDTDScanner.EventHandler
This interface must be implemented by the users of the XMLDTDScanner class. |
Constructor Summary | |
XMLDTDScanner(StringPool stringPool,
XMLErrorReporter errorReporter,
XMLEntityHandler entityHandler,
XMLEntityHandler.CharBuffer literalData)
|
Method Summary | |
void |
checkForAttributeNameWithPEReference(XMLEntityHandler.EntityReader entityReader,
char fastchar,
QName attribute)
|
void |
checkForElementTypeWithPEReference(XMLEntityHandler.EntityReader entityReader,
char fastchar,
QName element)
|
int |
checkForNameWithPEReference(XMLEntityHandler.EntityReader entityReader,
char fastcheck)
|
int |
checkForNmtokenWithPEReference(XMLEntityHandler.EntityReader entityReader,
char fastcheck)
|
void |
endOfInput(int entityNameIndex,
boolean moreToFollow)
Handle the end of input |
boolean |
getReadingContentSpec()
Is the scanner reading a ContentSpec? |
boolean |
getReadingExternalEntity()
Is the XMLDTDScanner reading from an external entity? This will be true, in particular if there was an external subset |
int |
markupDepth()
Report the markup nesting depth. |
int |
normalizeDefaultAttValue(QName attribute,
int defaultAttValue,
int attType,
int enumeration,
boolean list)
|
int |
parenDepth()
Report the parenthesis nesting depth. |
void |
readerChange(XMLEntityHandler.EntityReader nextReader,
int nextReaderId)
Change readers |
protected void |
reportRecoverableXMLError(int majorCode,
int minorCode,
int stringIndex1)
Report a recoverable xml error. |
protected void |
reportRecoverableXMLError(int majorCode,
int minorCode,
java.lang.String string1)
Report a recoverable xml error. |
protected void |
reportRecoverableXMLError(int majorCode,
int minorCode,
java.lang.String string1,
java.lang.String string2)
Report a recoverable xml error. |
void |
reset(StringPool stringPool,
XMLEntityHandler.CharBuffer literalData)
Allow XMLDTDScanner to be reused. |
void |
scanDecls(boolean extSubset)
Scan markup declarations |
int |
scanDefaultAttValue(QName element,
QName attribute)
Scan the default value in an attribute declaration |
int |
scanDefaultAttValue(QName element,
QName attribute,
int attType,
int enumeration)
|
boolean |
scanDoctypeDecl()
This routine is called after the <!DOCTYPE portion of a DOCTYPE line has been called. |
void |
setDTDHandler(XMLDocumentHandler.DTDHandler dtdHandler)
Set the DTD handler. |
void |
setEventHandler(XMLDTDScanner.EventHandler eventHandler)
Set the event handler |
void |
setGrammarResolver(GrammarResolver resolver)
Sets the grammar resolver. |
void |
setLoadExternalDTD(boolean enabled)
Sets whether the parser loads the external DTD. |
void |
setNamespacesEnabled(boolean enabled)
set fNamespacesEnabled |
void |
setValidationEnabled(boolean enabled)
set fValidationEnabled |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public XMLDTDScanner(StringPool stringPool, XMLErrorReporter errorReporter, XMLEntityHandler entityHandler, XMLEntityHandler.CharBuffer literalData)
Method Detail |
public void setEventHandler(XMLDTDScanner.EventHandler eventHandler)
eventHandler
- The place to send our callbacks.public void setDTDHandler(XMLDocumentHandler.DTDHandler dtdHandler)
public void setGrammarResolver(GrammarResolver resolver)
public void setNamespacesEnabled(boolean enabled)
public void setValidationEnabled(boolean enabled)
public void setLoadExternalDTD(boolean enabled)
public boolean getReadingExternalEntity()
public boolean getReadingContentSpec()
public int markupDepth()
public int parenDepth()
public void reset(StringPool stringPool, XMLEntityHandler.CharBuffer literalData) throws java.lang.Exception
stringPool
- the string pool to be used by XMLDTDScanner.protected void reportRecoverableXMLError(int majorCode, int minorCode, int stringIndex1) throws java.lang.Exception
protected void reportRecoverableXMLError(int majorCode, int minorCode, java.lang.String string1) throws java.lang.Exception
protected void reportRecoverableXMLError(int majorCode, int minorCode, java.lang.String string1, java.lang.String string2) throws java.lang.Exception
public void readerChange(XMLEntityHandler.EntityReader nextReader, int nextReaderId) throws java.lang.Exception
nextReader
- the new reader that the scanner will usenextReaderId
- id of the reader to change topublic void endOfInput(int entityNameIndex, boolean moreToFollow) throws java.lang.Exception
entityName
- the handle in the string pool of the name of the entity which has reached end of inputmoreToFollow
- if true, there is still input left to process in other readerspublic boolean scanDoctypeDecl() throws java.lang.Exception
public void scanDecls(boolean extSubset) throws java.lang.Exception
extSubset
- true if the scanner is scanning an external subset, false
if it is scanning an internal subsetpublic int scanDefaultAttValue(QName element, QName attribute) throws java.lang.Exception
elementType
- handle to the element that owns the attributeattrName
- handle in the string pool for the attribute namepublic void checkForElementTypeWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastchar, QName element) throws java.lang.Exception
public void checkForAttributeNameWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastchar, QName attribute) throws java.lang.Exception
public int checkForNameWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastcheck) throws java.lang.Exception
public int checkForNmtokenWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastcheck) throws java.lang.Exception
public int scanDefaultAttValue(QName element, QName attribute, int attType, int enumeration) throws java.lang.Exception
public int normalizeDefaultAttValue(QName attribute, int defaultAttValue, int attType, int enumeration, boolean list) throws java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |