Package org.apache.cocoon.xml.dom
Class DOMBuilder
- java.lang.Object
-
- org.apache.cocoon.xml.sax.AbstractSAXProducer
-
- org.apache.cocoon.xml.sax.AbstractSAXPipe
-
- org.apache.cocoon.xml.dom.DOMBuilder
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler,org.xml.sax.ext.LexicalHandler
public class DOMBuilder extends AbstractSAXPipe
TheDOMBuilderis a utility class that will generate a W3C DOM Document from SAX events.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDOMBuilder.ListenerThe Listener interface must be implemented by those objects willing to be notified of a successful DOM tree generation.
-
Constructor Summary
Constructors Constructor Description DOMBuilder()Construct a new instance of this DOMBuilder.DOMBuilder(javax.xml.transform.sax.SAXTransformerFactory factory)Construct a new instance of this DOMBuilder.DOMBuilder(javax.xml.transform.sax.SAXTransformerFactory factory, DOMBuilder.Listener listener, org.w3c.dom.Node parentNode)Construct a new instance of this DOMBuilder.DOMBuilder(DOMBuilder.Listener listener)Construct a new instance of this DOMBuilder.DOMBuilder(DOMBuilder.Listener listener, org.w3c.dom.Node parentNode)Construct a new instance of this DOMBuilder.DOMBuilder(org.w3c.dom.Node parentNode)Constructs a new instance that appends nodes to the given parent node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendDocument()Receive notification of the end of a document.org.w3c.dom.DocumentgetDocument()Return the newly built Document.voidrecycle()Recycle this builder, prepare for re-use.-
Methods inherited from class org.apache.cocoon.xml.sax.AbstractSAXPipe
characters, comment, endCDATA, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping
-
Methods inherited from class org.apache.cocoon.xml.sax.AbstractSAXProducer
setContentHandler
-
-
-
-
Constructor Detail
-
DOMBuilder
public DOMBuilder()
Construct a new instance of this DOMBuilder.
-
DOMBuilder
public DOMBuilder(javax.xml.transform.sax.SAXTransformerFactory factory)
Construct a new instance of this DOMBuilder.
-
DOMBuilder
public DOMBuilder(DOMBuilder.Listener listener)
Construct a new instance of this DOMBuilder.
-
DOMBuilder
public DOMBuilder(org.w3c.dom.Node parentNode)
Constructs a new instance that appends nodes to the given parent node.
Note: You cannot use aListenerwhen appending to aNode, because the notification occurs atendDocument()which does not happen here.
-
DOMBuilder
public DOMBuilder(DOMBuilder.Listener listener, org.w3c.dom.Node parentNode)
Construct a new instance of this DOMBuilder.
-
DOMBuilder
public DOMBuilder(javax.xml.transform.sax.SAXTransformerFactory factory, DOMBuilder.Listener listener, org.w3c.dom.Node parentNode)Construct a new instance of this DOMBuilder.
-
-
Method Detail
-
recycle
public void recycle()
Recycle this builder, prepare for re-use.- Overrides:
recyclein classAbstractSAXProducer
-
getDocument
public org.w3c.dom.Document getDocument()
Return the newly built Document.
-
endDocument
public void endDocument() throws org.xml.sax.SAXExceptionReceive notification of the end of a document.- Specified by:
endDocumentin interfaceorg.xml.sax.ContentHandler- Overrides:
endDocumentin classAbstractSAXPipe- Throws:
org.xml.sax.SAXException- If this method was not called appropriately.
-
-