AbstractChild, AbstractContentNode, Comment, Document, Element, Textpublic interface Node
Nodes are organized as a tree.
Implementations of Node are:
| Modifier and Type | Field | Description |
|---|---|---|
static java.util.function.Predicate<Node> |
ANY_NODE |
A Node Predicate that always return
true. |
static java.util.Comparator<Node> |
ELEMENT_NAME_AND_ATTRIBUTES_COMPARATOR |
|
static java.util.Comparator<Node> |
ELEMENT_NAME_COMPARATOR |
|
static java.util.function.Predicate<Node> |
IS_COMMENT |
A Node Predicate that returns
true when the node is a Comment. |
static java.util.function.Predicate<Node> |
IS_ELEMENT |
A Node Predicate that returns
true when the node is an Element. |
static java.util.function.Predicate<Node> |
IS_IGNORABLE_TEXT |
A Node Predicate that returns
true when the node is a Text that is ignorable. |
static java.util.function.Predicate<Node> |
IS_PURE_ELEMENT |
A Node Predicate that returns
true when the node is an Element
that has no attributes and no children . |
static java.util.function.Predicate<Node> |
IS_TEXT |
A Node Predicate that returns
true when the node is a Text. |
| Modifier and Type | Method | Description |
|---|---|---|
Node |
clone(boolean recurse) |
Return a clone of this node.
|
boolean |
deepEquals(Node node) |
Return true when this node and its descendants equals other node hierarchy.
|
Document |
getDocument() |
|
static java.lang.String |
getNameAndAttributes(Element element) |
|
java.lang.String |
getQName() |
|
Element |
getRootElement() |
Returns the root element of this node.
|
NodeType |
getType() |
static final java.util.function.Predicate<Node> ANY_NODE
true.static final java.util.function.Predicate<Node> IS_COMMENT
true when the node is a Comment.static final java.util.function.Predicate<Node> IS_ELEMENT
true when the node is an Element.static final java.util.function.Predicate<Node> IS_TEXT
true when the node is a Text.static final java.util.function.Predicate<Node> IS_PURE_ELEMENT
true when the node is an Element
that has no attributes and no children .static final java.util.function.Predicate<Node> IS_IGNORABLE_TEXT
true when the node is a Text that is ignorable.static final java.util.Comparator<Node> ELEMENT_NAME_COMPARATOR
static final java.util.Comparator<Node> ELEMENT_NAME_AND_ATTRIBUTES_COMPARATOR
static java.lang.String getNameAndAttributes(Element element)
NodeType getType()
Node clone(boolean recurse)
recurse - If true, also clone children nodes.boolean deepEquals(Node node)
Parents are ignored.
node - The other node to compare.Document getDocument()
Element getRootElement()
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, possibly null.
java.lang.String getQName()
Copyright © 2019. All rights reserved.