org.springframework.xml.xpath
Class AbstractXPathTemplate
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.xml.xpath.AbstractXPathTemplate
- All Implemented Interfaces:
- XPathOperations
- Direct Known Subclasses:
- JaxenXPathTemplate, Jaxp13XPathTemplate
public abstract class AbstractXPathTemplate
- extends TransformerObjectSupport
- implements XPathOperations
Abstract base class for implementations of XPathOperations
. Contains a namespaces property.
- Since:
- 1.0.0
- Author:
- Arjen Poutsma
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractXPathTemplate
public AbstractXPathTemplate()
getNamespaces
public Map<String,String> getNamespaces()
- Returns namespaces used in the XPath expression.
setNamespaces
public void setNamespaces(Map<String,String> namespaces)
- Sets namespaces used in the XPath expression. Maps prefixes to namespaces.
evaluate
public final void evaluate(String expression,
Source context,
NodeCallbackHandler callbackHandler)
throws XPathException
- Description copied from interface:
XPathOperations
- Evaluates the given expression, handling the result
Node
objects on a per-node basis with a NodeCallbackHandler
.
- Specified by:
evaluate
in interface XPathOperations
- Parameters:
expression
- the XPath expressioncontext
- the context starting pointcallbackHandler
- object that will extract results, one row at a time
- Throws:
XPathException
- in case of XPath errors- See Also:
- XPath specification
getRootElement
protected Element getRootElement(Source source)
throws TransformerException
- Returns the root element of the given source.
- Parameters:
source
- the source to get the root element from
- Returns:
- the root element
- Throws:
TransformerException
Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.