Package org.smooks.engine.delivery.dom
Class DOMBuilderContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.xml.sax.ext.DefaultHandler2
-
- org.smooks.engine.delivery.SmooksContentHandler
-
- org.smooks.engine.delivery.dom.DOMBuilderContentHandler
-
- All Implemented Interfaces:
SAXEventReplay
,ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,DeclHandler
,EntityResolver2
,LexicalHandler
public class DOMBuilderContentHandler extends SmooksContentHandler
DOM Document builder. Handler class for DOM construction.- Author:
- tom.fennelly@gmail.com
-
-
Constructor Summary
Constructors Constructor Description DOMBuilderContentHandler(ExecutionContext execContext)
DOMBuilderContentHandler(ExecutionContext execContext, SmooksContentHandler parentContentHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
close()
void
comment(char[] ch, int start, int length)
void
endCDATA()
void
endDocument()
void
endElement(EndElementEvent endEvent)
void
endEntity(String name)
Document
getDocument()
Get the Document node of the document into which this handler is parsing.void
ignorableWhitespace(char[] ch, int start, int length)
void
setAppendElement(Element appendElement)
Set the DOM Element node on which the parsed content it to be added.void
startCDATA()
void
startDocument()
void
startDTD(String name, String publicId, String systemId)
void
startElement(StartElementEvent startEvent)
void
startEntity(String name)
-
Methods inherited from class org.smooks.engine.delivery.SmooksContentHandler
detachHandler, endElement, getExecutionContext, getHandler, getNamespaceDeclarationStack, getNestedContentHandler, getParentContentHandler, replay, replayStartElement, resetNestedContentHandler, startElement
-
Methods inherited from class org.xml.sax.ext.DefaultHandler2
attributeDecl, elementDecl, endDTD, externalEntityDecl, getExternalSubset, internalEntityDecl, resolveEntity, resolveEntity
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
DOMBuilderContentHandler
public DOMBuilderContentHandler(ExecutionContext execContext)
-
DOMBuilderContentHandler
public DOMBuilderContentHandler(ExecutionContext execContext, SmooksContentHandler parentContentHandler)
-
-
Method Detail
-
startDocument
public void startDocument() throws SAXException
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classDefaultHandler
- Throws:
SAXException
-
getDocument
public Document getDocument()
Get the Document node of the document into which this handler is parsing.- Returns:
- Returns the ownerDocument.
-
setAppendElement
public void setAppendElement(Element appendElement)
Set the DOM Element node on which the parsed content it to be added. Used to merge ownerDocument fragments etc.- Parameters:
appendElement
- The append DOM element.
-
endDocument
public void endDocument() throws SAXException
- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
- Throws:
SAXException
-
startElement
public void startElement(StartElementEvent startEvent) throws SAXException
- Specified by:
startElement
in classSmooksContentHandler
- Throws:
SAXException
-
endElement
public void endElement(EndElementEvent endEvent) throws SAXException
- Specified by:
endElement
in classSmooksContentHandler
- Throws:
SAXException
-
close
public void close()
- Specified by:
close
in classSmooksContentHandler
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Overrides:
ignorableWhitespace
in classDefaultHandler
- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException
- Specified by:
startCDATA
in interfaceLexicalHandler
- Overrides:
startCDATA
in classDefaultHandler2
- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException
- Specified by:
endCDATA
in interfaceLexicalHandler
- Overrides:
endCDATA
in classDefaultHandler2
- Throws:
SAXException
-
comment
public void comment(char[] ch, int start, int length) throws SAXException
- Specified by:
comment
in interfaceLexicalHandler
- Overrides:
comment
in classDefaultHandler2
- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
- Specified by:
startEntity
in interfaceLexicalHandler
- Overrides:
startEntity
in classDefaultHandler2
- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
- Specified by:
endEntity
in interfaceLexicalHandler
- Overrides:
endEntity
in classDefaultHandler2
- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
- Specified by:
startDTD
in interfaceLexicalHandler
- Overrides:
startDTD
in classDefaultHandler2
- Throws:
SAXException
-
-