Package cdc.util.data
Class Document
- java.lang.Object
-
- cdc.util.data.Document
-
-
Field Summary
-
Fields inherited from interface cdc.util.data.Node
ANY_NODE, ELEMENT_NAME_AND_ATTRIBUTES_COMPARATOR, ELEMENT_NAME_COMPARATOR, IS_COMMENT, IS_ELEMENT, IS_IGNORABLE_TEXT, IS_PURE_ELEMENT, IS_TEXT
-
-
Constructor Summary
Constructors Constructor Description Document()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanAddChild(Child child)Returnstruewhen a child can be added.Documentclone(boolean recurse)Return a clone of this node.booleandeepEquals(Node node)Return true when this node and its descendants equals other node hierarchy.booleanequals(Object object)List<Child>getChildren()DocumentgetDocument()List<Child>getModifiableChildren()StringgetQName()ElementgetRootElement()Returns the root element of this node.static ElementgetRootElement(Document document)Returns the root element of a document.NodeTypegetType()inthashCode()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cdc.util.data.Parent
addChild, addChildren, addChildren, addComment, addComment, addElement, changeComments, changeComments, changeNamedTexts, changeNamedTexts, changeTexts, changeTexts, getChild, getChild, getChildAt, getChildAt, getChildAt, getChildren, getChildren, getChildrenCount, getChildrenCount, getChildrenCount, getComments, getElementNamed, getElementNamedAt, getElementNamedIgnoreCase, getElementNamedIgnoreCaseAt, getElementNamedWithAttribute, getElements, getElementsNamed, getElementsNamedIgnoreCase, getLastChild, getTexts, hasChildren, hasChildren, hasChildren, hasComments, hasElements, hasTexts, mergeComments, mergeComments, mergeTexts, mergeTexts, removeChild, removeChildAt, removeChildren, removeChildren, removeChildren, removeComments, removeComments, removeElementsNamed, removeElementsNamed, removeIgnorableTexts, removeIgnorableTexts, removeTexts, removeTexts, sortChildren, sortChildren
-
-
-
-
Method Detail
-
clone
public Document clone(boolean recurse)
Description copied from interface:NodeReturn a clone of this node.
-
deepEquals
public boolean deepEquals(Node node)
Description copied from interface:NodeReturn true when this node and its descendants equals other node hierarchy.Parents are ignored.
- Specified by:
deepEqualsin interfaceNode- Parameters:
node- The other node to compare.- Returns:
- True when this node and other node have same hierarchies.
-
getQName
public String getQName()
-
getDocument
public Document getDocument()
- Specified by:
getDocumentin interfaceNode- Returns:
- The document of this node, possibly null.
-
getRootElement
public Element getRootElement()
Description copied from interface:NodeReturns the root element of this node.If this node is a document, then this is its unique child element, possibly
null.
If this node is a child, then this is the highest ancestor that is an element, possiblynull.- Specified by:
getRootElementin interfaceNode- Returns:
- The root element of this node, possibly null.
-
getRootElement
public static Element getRootElement(Document document)
Returns the root element of a document.If
documentisnull, thennullis returned.- Parameters:
document- The document (possiblynull).- Returns:
- The root element of
document.
-
canAddChild
public boolean canAddChild(Child child)
Description copied from interface:ParentReturnstruewhen a child can be added.- Specified by:
canAddChildin interfaceParent- Parameters:
child- The child- Returns:
truewhenchildcan be added.
-
getModifiableChildren
public List<Child> getModifiableChildren()
- Specified by:
getModifiableChildrenin interfaceParent
-
getChildren
public List<Child> getChildren()
- Specified by:
getChildrenin interfaceParent- Returns:
- A list of children.
-
-