Package jodd.lagarto.dom
Class Document
- java.lang.Object
-
- jodd.lagarto.dom.Node
-
- jodd.lagarto.dom.Document
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Document extends Node
Document node is always a root node. Holds various DOM-related configuration and information.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jodd.lagarto.dom.Node
Node.NodeType
-
-
Field Summary
Fields Modifier and Type Field Description protected LagartoDomBuilderConfigconfigprotected longelapsedTimeprotected java.util.List<java.lang.String>errors-
Fields inherited from class jodd.lagarto.dom.Node
attributes, childElementNodes, childElementNodesCount, childNodes, nodeName, nodeRawName, nodeType, nodeValue, ownerDocument, parentNode, siblingElementIndex, siblingIndex, siblingNameIndex
-
-
Constructor Summary
Constructors Constructor Description Document()Document(LagartoDomBuilderConfig config)Document constructor with all relevant flags.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddError(java.lang.String message)Add new error message to theerrors list.Documentclone()protected voidend()Notifies document that parsing is done.LagartoDomBuilderConfiggetConfig()Returns usedLagartoDomBuilderConfig.longgetElapsedTime()Returns DOM building elapsed time.java.util.List<java.lang.String>getErrors()Returns list of warnings and errors occurred during parsing.voidsetAttribute(java.lang.String name, java.lang.String value)Document node does not have attributes.protected voidvisitNode(NodeVisitor nodeVisitor)Visits single node.-
Methods inherited from class jodd.lagarto.dom.Node
addChild, addChild, appendTextContent, changeOwnerDocument, check, cloneTo, detachFromParent, filterChildNodes, findChildNodeWithName, getAttribute, getAttribute, getAttributeInstance, getAttributesCount, getChild, getChild, getChildElement, getChildElements, getChildElementsCount, getChildElementsCount, getChildNodes, getChildNodesCount, getCssPath, getFirstChild, getFirstChildElement, getFirstChildElement, getHtml, getInnerHtml, getLastChild, getLastChildElement, getLastChildElement, getNextSibling, getNextSiblingElement, getNextSiblingName, getNodeName, getNodeRawName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getPreviousSiblingElement, getPreviousSiblingName, getSiblingElementIndex, getSiblingIndex, getSiblingNameIndex, getTextContent, hasAttribute, hasAttributes, hasChildNodes, indexOfAttributeInstance, initAttributes, initChildElementNodes, initChildNodes, initSiblingNames, insertAfter, insertAfter, insertBefore, insertBefore, insertChild, insertChild, isAttributeContaining, reindexChildren, reindexChildrenOnAdd, removeAllChilds, removeAttribute, removeChild, removeChild, setAttribute, setNodeValue, visit, visitChildren
-
-
-
-
Field Detail
-
elapsedTime
protected long elapsedTime
-
config
protected final LagartoDomBuilderConfig config
-
errors
protected java.util.List<java.lang.String> errors
-
-
Constructor Detail
-
Document
public Document()
-
Document
public Document(LagartoDomBuilderConfig config)
Document constructor with all relevant flags.
-
-
Method Detail
-
end
protected void end()
Notifies document that parsing is done.
-
visitNode
protected void visitNode(NodeVisitor nodeVisitor)
Description copied from class:NodeVisits single node. Implementations just needs to call the correct visitor callback function.
-
addError
public void addError(java.lang.String message)
Add new error message to theerrors list. If errors are not collected error, message is ignored.
-
getErrors
public java.util.List<java.lang.String> getErrors()
Returns list of warnings and errors occurred during parsing. Returnsnullif parsing was successful; or if errors are not collected.
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.String value)Document node does not have attributes.- Overrides:
setAttributein classNode
-
getElapsedTime
public long getElapsedTime()
Returns DOM building elapsed time.
-
getConfig
public LagartoDomBuilderConfig getConfig()
Returns usedLagartoDomBuilderConfig.
-
-