Package org.smooks.engine.delivery.dom
Class DOMBuilder
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.xml.sax.ext.DefaultHandler2
-
- org.smooks.engine.delivery.SmooksContentHandler
-
- org.smooks.engine.delivery.dom.DOMBuilder
-
- All Implemented Interfaces:
SAXEventReplay,ContentHandler,DTDHandler,EntityResolver,ErrorHandler,DeclHandler,EntityResolver2,LexicalHandler
public class DOMBuilder extends SmooksContentHandler
DOM Document builder. Handler class for DOM construction.- Author:
- tom.fennelly@gmail.com
-
-
Constructor Summary
Constructors Constructor Description DOMBuilder(ExecutionContext execContext)DOMBuilder(ExecutionContext execContext, SmooksContentHandler parentContentHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)voidclose()voidcomment(char[] ch, int start, int length)voidendCDATA()voidendDocument()voidendElement(EndElementEvent endEvent)voidendEntity(String name)DocumentgetDocument()Get the Document node of the document into which this handler is parsing.voidignorableWhitespace(char[] ch, int start, int length)voidsetAppendElement(Element appendElement)Set the DOM Element node on which the parsed content it to be added.voidstartCDATA()voidstartDocument()voidstartDTD(String name, String publicId, String systemId)voidstartElement(StartElementEvent startEvent)voidstartEntity(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
-
DOMBuilder
public DOMBuilder(ExecutionContext execContext)
-
DOMBuilder
public DOMBuilder(ExecutionContext execContext, SmooksContentHandler parentContentHandler)
-
-
Method Detail
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin 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:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
startElement
public void startElement(StartElementEvent startEvent) throws SAXException
- Specified by:
startElementin classSmooksContentHandler- Throws:
SAXException
-
endElement
public void endElement(EndElementEvent endEvent) throws SAXException
- Specified by:
endElementin classSmooksContentHandler- Throws:
SAXException
-
close
public void close()
- Specified by:
closein classSmooksContentHandler
-
characters
public void characters(char[] ch, int start, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classDefaultHandler- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException- Specified by:
startCDATAin interfaceLexicalHandler- Overrides:
startCDATAin classDefaultHandler2- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException- Specified by:
endCDATAin interfaceLexicalHandler- Overrides:
endCDATAin classDefaultHandler2- Throws:
SAXException
-
comment
public void comment(char[] ch, int start, int length) throws SAXException- Specified by:
commentin interfaceLexicalHandler- Overrides:
commentin classDefaultHandler2- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
- Specified by:
startEntityin interfaceLexicalHandler- Overrides:
startEntityin classDefaultHandler2- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
- Specified by:
endEntityin interfaceLexicalHandler- Overrides:
endEntityin classDefaultHandler2- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
- Specified by:
startDTDin interfaceLexicalHandler- Overrides:
startDTDin classDefaultHandler2- Throws:
SAXException
-
-