Package org.htmlcleaner
Class DomBuilder
- java.lang.Object
-
- org.htmlcleaner.DomBuilder
-
- All Implemented Interfaces:
XmlVisitor
public class DomBuilder extends java.lang.Object implements XmlVisitor
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
deserializeCdataEntities
protected boolean
escapeXml
protected boolean
strictErrorChecking
-
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.
-
-
-
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 interfaceXmlVisitor
- 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 interfaceXmlVisitor
- 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
-
-