Class DOMBuilder

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler

    public class DOMBuilder
    extends AbstractSAXPipe
    The DOMBuilder is a utility class that will generate a W3C DOM Document from SAX events.
    • 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 a Listener when appending to a Node, because the notification occurs at endDocument() 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

      • 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 interface org.xml.sax.ContentHandler
        Overrides:
        endDocument in class AbstractSAXPipe
        Throws:
        org.xml.sax.SAXException - If this method was not called appropriately.