|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.framework.XMLDocumentScanner
This class recognizes most of the grammer for an XML processor. Additional support is provided by the XMLEntityHandler, via the XMLEntityReader instances it creates, which are used to process simple constructs like string literals and character data between markup. The XMLDTDScanner class contains the remaining support for the grammer of DTD declarations. When a <!DOCTYPE ...> is found in the document, the scanDoctypeDecl method will then be called and the XMLDocumentScanner subclass is responsible for "connecting" that method to the corresponding method provided by the XMLDTDScanner class.
Inner Class Summary | |
---|---|
static interface |
XMLDocumentScanner.EventHandler
This interface must be implemented by the users of the XMLDocumentScanner class. |
Field Summary | |
---|---|
static int |
RESULT_DUPLICATE_ATTR
|
static int |
RESULT_FAILURE
|
static int |
RESULT_SUCCESS
|
Constructor Summary | |
---|---|
XMLDocumentScanner(StringPool stringPool,
XMLErrorReporter errorReporter,
XMLEntityHandler entityHandler,
XMLEntityHandler.CharBuffer literalData)
Constructor |
Method Summary | |
---|---|
boolean |
atEndOfInput()
Tell if scanner has reached end of input |
void |
endOfInput(int entityName,
boolean moreToFollow)
Handle the end of input |
int |
getCurrentElementType()
|
boolean |
getLoadExternalDTD()
Returns true if loading the external DTD is turned on. |
boolean |
getNamespacesEnabled()
Returns whether the parser processes namespaces. |
boolean |
getValidationEnabled()
Returns true if validation is turned on. |
boolean |
parseSome(boolean doItAll)
Entry point for parsing |
void |
readerChange(XMLEntityHandler.EntityReader nextReader,
int nextReaderId)
Change readers |
void |
reset(StringPool stringPool,
XMLEntityHandler.CharBuffer literalData)
reset the parser so that the instance can be reused |
int |
scanAttValue(QName element,
QName attribute,
boolean asSymbol)
Scan an attribute value |
void |
setDTDHandler(XMLDocumentHandler.DTDHandler dtdHandler)
Set the DTD handler. |
void |
setEventHandler(XMLDocumentScanner.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)
Sets whether the parser preprocesses namespaces. |
void |
setValidationEnabled(boolean enabled)
Sets whether the parser validates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RESULT_SUCCESS
public static final int RESULT_FAILURE
public static final int RESULT_DUPLICATE_ATTR
Constructor Detail |
public XMLDocumentScanner(StringPool stringPool, XMLErrorReporter errorReporter, XMLEntityHandler entityHandler, XMLEntityHandler.CharBuffer literalData)
Method Detail |
public void setEventHandler(XMLDocumentScanner.EventHandler eventHandler)
eventHandler
- The place to send our callbacks.public void setDTDHandler(XMLDocumentHandler.DTDHandler dtdHandler)
public void setGrammarResolver(GrammarResolver resolver)
public void reset(StringPool stringPool, XMLEntityHandler.CharBuffer literalData)
stringPool
- the string pool instance to be used by the reset parserpublic boolean parseSome(boolean doItAll) throws java.lang.Exception
doItAll
- if true the entire document is parsed otherwise just
the next segment of the document is parsedpublic 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 tothrows
- java.lang.Exceptionpublic void endOfInput(int entityName, 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 readersjava.lang.Exception
- public boolean atEndOfInput()
public int scanAttValue(QName element, QName attribute, boolean asSymbol) throws java.lang.Exception
elementType
- handle to the element whose attribute value is being scannedattrName
- handle in the string pool of the name of attribute being scannedasSymbol
- controls whether the value is a string (duplicates allowed) or a symbol (duplicates not allowed)java.lang.Exception
- public int getCurrentElementType()
public void setNamespacesEnabled(boolean enabled)
public boolean getNamespacesEnabled()
public void setValidationEnabled(boolean enabled)
public boolean getValidationEnabled()
public void setLoadExternalDTD(boolean enabled)
public boolean getLoadExternalDTD()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |