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
TheDOMBuilder
is a utility class that will generate a W3C DOM Document from SAX events.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DOMBuilder.Listener
The 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 void
endDocument()
Receive notification of the end of a document.org.w3c.dom.Document
getDocument()
Return the newly built Document.void
recycle()
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 aListener
when appending to a
Node
, 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:
recycle
in classAbstractSAXProducer
-
getDocument
public org.w3c.dom.Document getDocument()
Return the newly built Document.
-
endDocument
public void endDocument() throws org.xml.sax.SAXException
Receive notification of the end of a document.- Specified by:
endDocument
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endDocument
in classAbstractSAXPipe
- Throws:
org.xml.sax.SAXException
- If this method was not called appropriately.
-
-