public interface XPath
| Modifier and Type | Method and Description |
|---|---|
XPath |
addNode(java.lang.String name)
Adds a node with the given name into each of the current nodes and
returns an XPath containing all created nodes
|
XPath |
any()
Recursively returns an XPath containing all current nodes and all their
children
|
java.util.stream.Stream<Result<java.lang.String>> |
attribute(java.lang.String name)
Returns a stream containing the attribute value for a given attribute
name for each element
|
java.util.stream.Stream<java.util.List<T2<java.lang.String,java.lang.String>>> |
attributes()
Returns a stream containing a list of attribute tuples for each elements
|
XPath |
children()
Returns an XPath containing all children of all current nodes
|
void |
dropNode()
Removes all current elements from the XML
|
default XPath |
filterAttribute(java.lang.String name)
Returns an XPath containing all current elements that contain an argument
with the given name
|
XPath |
filterAttribute(java.lang.String name,
java.util.function.Predicate<java.lang.String> predicate)
Returns an XPath containing all current elements that have a given
attribute validated by a given predicate
|
default XPath |
filterAttribute(java.lang.String name,
java.lang.String value)
Returns an XPath containing all current elements that have a given
attribute with a given value
|
XPath |
filterName(java.util.function.Predicate<java.lang.String> predicate)
Returns an XPath containing all current elements that have a name
validated by a given predicate
|
default XPath |
index(int index)
Returns an XPath containing the node with a given index
|
XPath |
indexRange(int from,
int amount)
Returns an XPath containing a given number of nodes starting at a given
index
|
java.util.stream.Stream<org.w3c.dom.Node> |
node()
Returns a stream containing all DOM nodes of all current elements
|
default XPath |
node(java.lang.String name)
Returns an XPath containing all children of all current nodes that match
the given name
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Inserts the given attribute into all current elements.
|
void |
setText(java.lang.String text)
Replaces the text content of all current elements by a given String
|
java.util.stream.Stream<Result<java.lang.String>> |
text()
Returns a stream containing the text of all current elements
|
void |
updateText(java.util.function.UnaryOperator<java.lang.String> updater)
Replaces the text of each element by the value returned by the updater
method.
|
XPath any()
XPath children()
default XPath node(java.lang.String name)
name - default XPath filterAttribute(java.lang.String name)
name - XPath filterName(java.util.function.Predicate<java.lang.String> predicate)
predicate - default XPath filterAttribute(java.lang.String name, java.lang.String value)
name - value - XPath filterAttribute(java.lang.String name, java.util.function.Predicate<java.lang.String> predicate)
name - predicate - default XPath index(int index)
index - XPath indexRange(int from, int amount)
from - amount - java.util.stream.Stream<Result<java.lang.String>> text()
java.util.stream.Stream<java.util.List<T2<java.lang.String,java.lang.String>>> attributes()
java.util.stream.Stream<org.w3c.dom.Node> node()
java.util.stream.Stream<Result<java.lang.String>> attribute(java.lang.String name)
void setText(java.lang.String text)
text - void setAttribute(java.lang.String name,
java.lang.String value)
null, the attribute will be removed.name - value - void dropNode()
void updateText(java.util.function.UnaryOperator<java.lang.String> updater)
updater - XPath addNode(java.lang.String name)
name - Copyright © 2018. All Rights Reserved.