Class Jaxp13XPathTemplate
- All Implemented Interfaces:
- XPathOperations
XPathOperations that uses JAXP 1.3. JAXP 1.3 is part of Java SE since 1.5.
 
 Namespaces can be set using the namespaces property.
- Since:
- 1.0.0
- Author:
- Arjen Poutsma
- See Also:
- 
Field SummaryFields inherited from class org.springframework.xml.transform.TransformerObjectSupportlogger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<T> List<T>evaluate(String expression, Source context, NodeMapper<T> nodeMapper) Evaluates the given expression, mapping each resultNodeobjects to a Java object via aNodeMapper.booleanevaluateAsBoolean(String expression, Source context) Evaluates the given expression as aboolean.doubleevaluateAsDouble(String expression, Source context) Evaluates the given expression as adouble.evaluateAsNode(String expression, Source context) Evaluates the given expression as aNode.evaluateAsNodeList(String expression, Source context) Evaluates the given expression as a list ofNodeobjects.<T> TevaluateAsObject(String expression, Source context, NodeMapper<T> nodeMapper) Evaluates the given expression, mapping a singleNoderesult to a Java object via aNodeMapper.evaluateAsString(String expression, Source context) Evaluates the given expression as aString.Methods inherited from class org.springframework.xml.xpath.AbstractXPathTemplateevaluate, getNamespaces, getRootElement, setNamespacesMethods inherited from class org.springframework.xml.transform.TransformerObjectSupportcreateTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
- 
Constructor Details- 
Jaxp13XPathTemplatepublic Jaxp13XPathTemplate()
- 
Jaxp13XPathTemplate
 
- 
- 
Method Details- 
evaluateAsBooleanDescription copied from interface:XPathOperationsEvaluates the given expression as aboolean. Returns the boolean evaluation of the expression, orfalseif it is invalid.The return value is determined per the boolean()function defined in the XPath specification. This means that an expression that selects zero nodes will returnfalse, while an expression that selects one or more nodes will returntrue. An expression that returns a string returnsfalsefor empty strings andtruefor all other strings. An expression that returns a number returnsfalsefor zero andtruefor non-zero numbers.- Parameters:
- expression- the XPath expression
- context- the context starting point
- Returns:
- the result of the evaluation
- Throws:
- XPathException- in case of XPath errors
- See Also:
 
- 
evaluateAsNodeDescription copied from interface:XPathOperationsEvaluates the given expression as aNode. Returns the evaluation of the expression, ornullif it is invalid.- Parameters:
- expression- the XPath expression
- context- the context starting point
- Returns:
- the result of the evaluation
- Throws:
- XPathException- in case of XPath errors
- See Also:
 
- 
evaluateAsNodeListDescription copied from interface:XPathOperationsEvaluates the given expression as a list ofNodeobjects. Returns the evaluation of the expression, or an empty list if no results are found.- Parameters:
- expression- the XPath expression
- context- the context starting point
- Returns:
- the result of the evaluation
- Throws:
- XPathException- in case of XPath errors
- See Also:
 
- 
evaluateAsDoubleDescription copied from interface:XPathOperationsEvaluates the given expression as adouble. Returns the evaluation of the expression, orDouble.NaNif it is invalid.The return value is determined per the number()function as defined in the XPath specification. This means that if the expression selects multiple nodes, it will return the number value of the first node.- Parameters:
- expression- the XPath expression
- context- the context starting point
- Returns:
- the result of the evaluation
- Throws:
- XPathException- in case of XPath errors
- See Also:
 
- 
evaluateAsStringDescription copied from interface:XPathOperationsEvaluates the given expression as aString. Returns the evaluation of the expression, ornullif it is invalid.The return value is determined per the string()function as defined in the XPath specification. This means that if the expression selects multiple nodes, it will return the string value of the first node.- Parameters:
- expression- the XPath expression
- context- the context starting point
- Returns:
- the result of the evaluation
- Throws:
- XPathException- in case of XPath errors
- See Also:
 
- 
evaluateAsObjectpublic <T> T evaluateAsObject(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException Description copied from interface:XPathOperationsEvaluates the given expression, mapping a singleNoderesult to a Java object via aNodeMapper.- Parameters:
- expression- the XPath expression
- context- the context starting point
- nodeMapper- object that will map one object per node
- Returns:
- the single mapped object
- Throws:
- XPathException- in case of XPath errors
- See Also:
 
- 
evaluatepublic <T> List<T> evaluate(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException Description copied from interface:XPathOperationsEvaluates the given expression, mapping each resultNodeobjects to a Java object via aNodeMapper.- Parameters:
- expression- the XPath expression
- context- the context starting point
- nodeMapper- object that will map one object per node
- Returns:
- the result list, containing mapped objects
- Throws:
- XPathException- in case of XPath errors
- See Also:
 
 
-