Class DomBuilder

  • All Implemented Interfaces:
    XmlVisitor

    public class DomBuilder
    extends java.lang.Object
    implements XmlVisitor
    • Field Detail

      • document

        private org.w3c.dom.Document document
      • destinationElement

        private org.w3c.dom.Element destinationElement
      • escapeXml

        protected boolean escapeXml
      • deserializeCdataEntities

        protected boolean deserializeCdataEntities
      • strictErrorChecking

        protected boolean strictErrorChecking
      • CSS_COMMENT_START

        private static final java.lang.String CSS_COMMENT_START
        See Also:
        Constant Field Values
    • Constructor Detail

      • DomBuilder

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

      • getDocument

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

        private boolean shouldEscapeOrTranslateEntities()
      • 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