Class XPathUtils
java.lang.Object
org.springframework.integration.xml.xpath.XPathUtils
public final class XPathUtils extends Object
Utility class for 'xpath' support.
- Since:
- 3.0
- Author:
- Artem Bilan, Gary Russell
-
Field Details
-
STRING
- See Also:
- Constant Field Values
-
BOOLEAN
- See Also:
- Constant Field Values
-
NUMBER
- See Also:
- Constant Field Values
-
NODE
- See Also:
- Constant Field Values
-
NODE_LIST
- See Also:
- Constant Field Values
-
DOCUMENT_LIST
- See Also:
- Constant Field Values
-
-
Method Details
-
evaluate
Utility method to evaluate an xpath on the provided object. Delegates evaluation to anXPathExpression. Note this method provides the#xpath()SpEL function.- Type Parameters:
T- The required return type.- Parameters:
object- the xml Object for evaluation.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 ofNodeMapperor one of these String constants: "string", "boolean", "number", "node" or "node_list".- Returns:
- the result of the xpath expression evaluation.
- Throws:
IllegalArgumentException- - if the provided arguments aren't appropriate types or values;MessagingException- - if the provided object can't be converted to aNode;XPathException- - if the xpath expression can't be evaluated.
-