Class DomBuilder

  • All Implemented Interfaces:
    XmlVisitor

    public class DomBuilder
    extends java.lang.Object
    implements XmlVisitor
    • Constructor Summary

      Constructors 
      Constructor Description
      DomBuilder​(CleanerProperties props, boolean escapeXml, boolean deserializeCdataEntities, boolean strictErrorChecking)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.w3c.dom.Document createDocument​(TagNode rootNode)  
      protected java.lang.String deserializeCdataEntities​(java.lang.String input)  
      org.w3c.dom.Document getDocument()  
      void head​(HtmlNode node, int depth)
      Callback for when a node is first visited.
      void tail​(HtmlNode node, int depth)
      Callback for when a node is last visited, after all of its descendants have been visited.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • escapeXml

        protected boolean escapeXml
      • deserializeCdataEntities

        protected boolean deserializeCdataEntities
      • strictErrorChecking

        protected boolean strictErrorChecking
    • Constructor Detail

      • DomBuilder

        public DomBuilder​(CleanerProperties props,
                          boolean escapeXml,
                          boolean deserializeCdataEntities,
                          boolean strictErrorChecking)
    • Method Detail

      • getDocument

        public org.w3c.dom.Document getDocument()
      • head

        public void head​(HtmlNode node,
                         int depth)
        Description copied from interface: XmlVisitor
        Callback for when a node is first visited.
        Specified by:
        head in interface XmlVisitor
        Parameters:
        node - the node being visited.
        depth - the depth of the node, relative to the root node. E.g., the root node has depth 0, and a child node of that will have depth 1.
      • deserializeCdataEntities

        protected java.lang.String deserializeCdataEntities​(java.lang.String input)
      • tail

        public void tail​(HtmlNode node,
                         int depth)
        Description copied from interface: XmlVisitor
        Callback for when a node is last visited, after all of its descendants have been visited.
        Specified by:
        tail in interface XmlVisitor
        Parameters:
        node - the node being visited.
        depth - the depth of the node, relative to the root node. E.g., the root node has depth 0, and a child node of that will have depth 1.
      • createDocument

        protected org.w3c.dom.Document createDocument​(TagNode rootNode)
                                               throws javax.xml.parsers.ParserConfigurationException
        Throws:
        javax.xml.parsers.ParserConfigurationException