public final class XPathUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BOOLEAN |
static java.lang.String |
DOCUMENT_LIST |
static java.lang.String |
NODE |
static java.lang.String |
NODE_LIST |
static java.lang.String |
NUMBER |
static java.lang.String |
STRING |
Modifier and Type | Method and Description |
---|---|
static <T> T |
evaluate(java.lang.Object o,
java.lang.String xpath,
java.lang.Object... resultArg)
Utility method to evaluate an xpath on the provided object.
|
public static final java.lang.String STRING
public static final java.lang.String BOOLEAN
public static final java.lang.String NUMBER
public static final java.lang.String NODE
public static final java.lang.String NODE_LIST
public static final java.lang.String DOCUMENT_LIST
public static <T> T evaluate(java.lang.Object o, java.lang.String xpath, java.lang.Object... resultArg)
XPathExpression
.
Note this method provides the #xpath()
SpEL function.o
- the xml Object for evaluaton.xpath
- an 'xpath' expression String.resultArg
- an optional parameter to represent the result type of the xpath evaluation.
Only one argument is allowed, which can be an instance of NodeMapper
or
one of these String constants: "string", "boolean", "number", "node" or "node_list".java.lang.IllegalArgumentException
- - if the provided arguments aren't appropriate types or values;MessagingException
- - if the provided object can't be converted to a Node
;org.springframework.xml.xpath.XPathException
- - if the xpath expression can't be evaluated.