public interface Node
| Modifier and Type | Method and Description |
|---|---|
@NonNull NodeStreamElement<Node> |
attribute(@NonNull java.lang.String name)
Gets an attribute by its name.
|
@NonNull NodeStream |
attributes()
Creates a stream of nodes from the attributes of this node.
|
@NonNull NodeStream |
attributes(@NonNull java.util.Collection<java.lang.String> names)
Creates a stream of nodes from the attributes of this node matching a set of names.
|
default @NonNull NodeStream |
attributes(java.lang.String... names)
Creates a stream of nodes from the attributes of this node matching a set of names.
|
default @NonNull NodeStreamElement<Node> |
element(@NonNull java.lang.String name)
Gets a single element node by its name.
|
@NonNull NodeStream |
elements()
Creates a stream of nodes from the children elements of this node.
|
@NonNull NodeStream |
elements(@NonNull java.util.Collection<java.lang.String> names)
Creates a stream of nodes from the children elements of this node matching a set of names.
|
default @NonNull NodeStream |
elements(java.lang.String... names)
Creates a stream of nodes from the children elements of this node matching a set of names.
|
default @NonNull NodeStream |
elements(@NonNull java.lang.String name)
Creates a stream of nodes from the children elements of this node matching a name.
|
static @NonNull java.util.Optional<AttributeNode> |
maybeOf(@Nullable org.jdom2.Attribute attribute)
Creates a node from an attribute.
|
static @NonNull java.util.Optional<ElementNode> |
maybeOf(@Nullable org.jdom2.Element element)
Creates a node from an element.
|
@NonNull java.lang.String |
name()
Gets the name of this node.
|
default @NonNull NodeStreamElement<Node> |
node(@NonNull java.lang.String name)
Gets a single node by its name.
|
default @NonNull NodeStream |
nodes()
Creates a stream of nodes from the attributes and children elements of this node.
|
default @NonNull NodeStream |
nodes(@NonNull java.util.Collection<java.lang.String> names)
Creates a stream of nodes from the attributes and children elements of this node matching a set of names.
|
default @NonNull NodeStream |
nodes(java.lang.String... names)
Creates a stream of nodes from the attributes and children elements of this node matching a set of names.
|
default @NonNull NodeStream |
nodes(@NonNull java.lang.String name)
Creates a stream of nodes from the attributes and children elements of this node matching a name.
|
@NonNull java.lang.String |
normalizedValue()
Gets the normalized value of this node.
|
static @NonNull AttributeNode |
of(@NonNull org.jdom2.Attribute attribute)
Creates a node from an attribute.
|
static @NonNull ElementNode |
of(@NonNull org.jdom2.Element element)
Creates a node from an element.
|
default @NonNull Node |
requireAttribute(@NonNull java.lang.String name)
Gets a required attribute by its name.
|
@NonNull java.lang.String |
value()
Gets the value of this node.
|
static @NonNull AttributeNode of(@NonNull org.jdom2.Attribute attribute)
attribute - the attributestatic @NonNull java.util.Optional<AttributeNode> maybeOf(@Nullable org.jdom2.Attribute attribute)
attribute - the attributestatic @NonNull ElementNode of(@NonNull org.jdom2.Element element)
element - the elementstatic @NonNull java.util.Optional<ElementNode> maybeOf(@Nullable org.jdom2.Element element)
element - the element@NonNull java.lang.String name()
@NonNull java.lang.String value()
@NonNull java.lang.String normalizedValue()
default @NonNull NodeStreamElement<Node> node(@NonNull java.lang.String name)
name - the namejava.lang.IllegalArgumentException - if more than one node named name is founddefault @NonNull NodeStream nodes()
default @NonNull NodeStream nodes(@NonNull java.lang.String name)
name - the namedefault @NonNull NodeStream nodes(java.lang.String... names)
names - the namesdefault @NonNull NodeStream nodes(@NonNull java.util.Collection<java.lang.String> names)
names - the names@NonNull NodeStreamElement<Node> attribute(@NonNull java.lang.String name)
name - the namedefault @NonNull Node requireAttribute(@NonNull java.lang.String name) throws XMLException
name - the nameXMLException - if the attribute is not available@NonNull NodeStream attributes()
default @NonNull NodeStream attributes(java.lang.String... names)
names - the names@NonNull NodeStream attributes(@NonNull java.util.Collection<java.lang.String> names)
names - the namesdefault @NonNull NodeStreamElement<Node> element(@NonNull java.lang.String name)
name - the namejava.lang.IllegalArgumentException - if more than one element named name is found@NonNull NodeStream elements()
default @NonNull NodeStream elements(@NonNull java.lang.String name)
name - the namedefault @NonNull NodeStream elements(java.lang.String... names)
names - the names@NonNull NodeStream elements(@NonNull java.util.Collection<java.lang.String> names)
names - the names