Package org.apache.xerces.impl
Class XMLDocumentScannerImpl.ContentDispatcher
- java.lang.Object
-
- org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.FragmentContentDispatcher
-
- org.apache.xerces.impl.XMLDocumentScannerImpl.ContentDispatcher
-
- All Implemented Interfaces:
XMLDocumentFragmentScannerImpl.Dispatcher
- Direct Known Subclasses:
XML11NSDocumentScannerImpl.NS11ContentDispatcher,XMLNSDocumentScannerImpl.NSContentDispatcher
- Enclosing class:
- XMLDocumentScannerImpl
protected class XMLDocumentScannerImpl.ContentDispatcher extends XMLDocumentFragmentScannerImpl.FragmentContentDispatcher
Dispatcher to handle content scanning.- Author:
- Andy Clark, IBM, Eric Ye, IBM
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedContentDispatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanelementDepthIsZeroHook()Element depth iz zero.protected voidendOfFileHook(java.io.EOFException e)End of file hook.protected voidresolveExternalSubsetAndRead()Attempt to locate an external subset for a document that does not otherwise have one.protected booleanscanForDoctypeHook()Scan for DOCTYPE hook.protected booleanscanRootElementHook()Scan for root element hook.-
Methods inherited from class org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.FragmentContentDispatcher
dispatch
-
-
-
-
Method Detail
-
scanForDoctypeHook
protected boolean scanForDoctypeHook() throws java.io.IOException, org.apache.xerces.xni.XNIExceptionScan for DOCTYPE hook. This method is a hook for subclasses to add code to handle scanning for a the "DOCTYPE" string after the string "- Overrides:
scanForDoctypeHookin classXMLDocumentFragmentScannerImpl.FragmentContentDispatcher- Returns:
- True if the "DOCTYPE" was scanned; false if "DOCTYPE" was not scanned.
- Throws:
java.io.IOExceptionorg.apache.xerces.xni.XNIException
-
elementDepthIsZeroHook
protected boolean elementDepthIsZeroHook() throws java.io.IOException, org.apache.xerces.xni.XNIExceptionElement depth iz zero. This methos is a hook for subclasses to add code to handle when the element depth hits zero. When scanning a document fragment, an element depth of zero is normal. However, when scanning a full XML document, the scanner must handle the trailing miscellanous section of the document after the end of the document's root element.- Overrides:
elementDepthIsZeroHookin classXMLDocumentFragmentScannerImpl.FragmentContentDispatcher- Returns:
- True if the caller should stop and return true which allows the scanner to switch to a new scanning dispatcher. A return value of false indicates that the content dispatcher should continue as normal.
- Throws:
java.io.IOExceptionorg.apache.xerces.xni.XNIException
-
scanRootElementHook
protected boolean scanRootElementHook() throws java.io.IOException, org.apache.xerces.xni.XNIExceptionScan for root element hook. This method is a hook for subclasses to add code that handles scanning for the root element. When scanning a document fragment, there is no "root" element. However, when scanning a full XML document, the scanner must handle the root element specially.- Overrides:
scanRootElementHookin classXMLDocumentFragmentScannerImpl.FragmentContentDispatcher- Returns:
- True if the caller should stop and return true which allows the scanner to switch to a new scanning dispatcher. A return value of false indicates that the content dispatcher should continue as normal.
- Throws:
java.io.IOExceptionorg.apache.xerces.xni.XNIException
-
endOfFileHook
protected void endOfFileHook(java.io.EOFException e) throws java.io.IOException, org.apache.xerces.xni.XNIExceptionEnd of file hook. This method is a hook for subclasses to add code that handles the end of file. The end of file in a document fragment is OK if the markup depth is zero. However, when scanning a full XML document, an end of file is always premature.- Overrides:
endOfFileHookin classXMLDocumentFragmentScannerImpl.FragmentContentDispatcher- Throws:
java.io.IOExceptionorg.apache.xerces.xni.XNIException
-
resolveExternalSubsetAndRead
protected void resolveExternalSubsetAndRead() throws java.io.IOException, org.apache.xerces.xni.XNIExceptionAttempt to locate an external subset for a document that does not otherwise have one. If an external subset is located, then it is scanned.
- Throws:
java.io.IOExceptionorg.apache.xerces.xni.XNIException
-
-