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
Method Summary |
void |
evaluate(java.lang.String expression,
javax.xml.transform.Source context,
NodeCallbackHandler callbackHandler)
Evaluates the given expression, handling the result Node objects on a per-node basis with a NodeCallbackHandler . |
java.util.Properties |
getNamespaces()
Returns namespaces used in the XPath expression. |
protected org.w3c.dom.Element |
getRootElement(javax.xml.transform.Source source)
Returns the root element of the given source. |
void |
setNamespaces(java.util.Properties namespaces)
Sets namespaces used in the XPath expression. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractXPathTemplate
public AbstractXPathTemplate()
getNamespaces
public java.util.Properties getNamespaces()
- Returns namespaces used in the XPath expression.
setNamespaces
public void setNamespaces(java.util.Properties namespaces)
- Sets namespaces used in the XPath expression. Maps prefixes to namespaces.
evaluate
public final void evaluate(java.lang.String expression,
javax.xml.transform.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 org.w3c.dom.Element getRootElement(javax.xml.transform.Source source)
throws javax.xml.transform.TransformerException
- Returns the root element of the given source.
- Parameters:
source
- the source to get the root element from
- Returns:
- the root element
- Throws:
javax.xml.transform.TransformerException
Copyright � 2005-2008 The Spring Web Services Framework. All Rights Reserved.