Spring Web Services Framework

org.springframework.xml.xpath
Class AbstractXPathTemplate

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by 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

Field Summary
 
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
 
Constructor Summary
AbstractXPathTemplate()
           
 
Method Summary
 void evaluate(String expression, Source context, NodeCallbackHandler callbackHandler)
          Evaluates the given expression, handling the result Node objects on a per-node basis with a NodeCallbackHandler.
 Properties getNamespaces()
          Returns namespaces used in the XPath expression.
protected  Element getRootElement(Source source)
          Returns the root element of the given source.
 void setNamespaces(Properties namespaces)
          Sets namespaces used in the XPath expression.
 
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.xml.xpath.XPathOperations
evaluate, evaluateAsBoolean, evaluateAsDouble, evaluateAsNode, evaluateAsNodeList, evaluateAsObject, evaluateAsString
 

Constructor Detail

AbstractXPathTemplate

public AbstractXPathTemplate()
Method Detail

getNamespaces

public Properties getNamespaces()
Returns namespaces used in the XPath expression.


setNamespaces

public void setNamespaces(Properties 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 expression
context - the context starting point
callbackHandler - 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

Spring Web Services Framework

Copyright © 2005-2010 The Spring Web Services Framework. All Rights Reserved.