Class XMLDocumentFragmentScannerImpl.FragmentContentDispatcher
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.FragmentContentDispatcher
-
- All Implemented Interfaces:
XMLDocumentFragmentScannerImpl.Dispatcher
- Direct Known Subclasses:
XMLDocumentScannerImpl.ContentDispatcher
- Enclosing class:
- XMLDocumentFragmentScannerImpl
protected class XMLDocumentFragmentScannerImpl.FragmentContentDispatcher extends Object implements XMLDocumentFragmentScannerImpl.Dispatcher
Dispatcher to handle content scanning.- Author:
- Andy Clark, IBM, Eric Ye, IBM
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FragmentContentDispatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
dispatch(boolean complete)
Dispatch an XML "event".protected boolean
elementDepthIsZeroHook()
Element depth iz zero.protected void
endOfFileHook(EOFException e)
End of file hook.protected boolean
scanForDoctypeHook()
Scan for DOCTYPE hook.protected boolean
scanRootElementHook()
Scan for root element hook.
-
-
-
Method Detail
-
dispatch
public boolean dispatch(boolean complete) throws IOException, XNIException
Dispatch an XML "event".- Specified by:
dispatch
in interfaceXMLDocumentFragmentScannerImpl.Dispatcher
- Parameters:
complete
- True if this dispatcher is intended to scan and dispatch as much as possible.- Returns:
- True if there is more to dispatch either from this or a another dispatcher.
- Throws:
IOException
- Thrown on i/o error.XNIException
- Thrown on parse error.
-
scanForDoctypeHook
protected boolean scanForDoctypeHook() throws IOException, XNIException
Scan for DOCTYPE hook. This method is a hook for subclasses to add code to handle scanning for a the "DOCTYPE" string after the string "- Returns:
- True if the "DOCTYPE" was scanned; false if "DOCTYPE" was not scanned.
- Throws:
IOException
XNIException
-
elementDepthIsZeroHook
protected boolean elementDepthIsZeroHook() throws IOException, XNIException
Element 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.- 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:
IOException
XNIException
-
scanRootElementHook
protected boolean scanRootElementHook() throws IOException, XNIException
Scan 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.- 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:
IOException
XNIException
-
endOfFileHook
protected void endOfFileHook(EOFException e) throws IOException, XNIException
End 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.- Throws:
IOException
XNIException
-
-