org.springframework.xml.xpath
Class XPathExpressionFactory
java.lang.Object
org.springframework.xml.xpath.XPathExpressionFactory
public abstract class XPathExpressionFactory
- extends Object
Factory for compiled XPathExpression
s, being aware of JAXP 1.3+ XPath functionality, and Jaxen. Mainly
for internal use of the framework.
The goal of this class is to avoid runtime dependencies a specific XPath engine, simply using the best XPath
implementation that is available. Prefers JAXP 1.3+ XPath implementations to Jaxen.
- Since:
- 1.0.0
- Author:
- Arjen Poutsma
- See Also:
XPathExpression
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XPathExpressionFactory
public XPathExpressionFactory()
createXPathExpression
public static XPathExpression createXPathExpression(String expression)
throws IllegalStateException,
XPathParseException
- Create a compiled XPath expression using the given string.
- Parameters:
expression
- the XPath expression
- Returns:
- the compiled XPath expression
- Throws:
IllegalStateException
- if neither JAXP 1.3+, or Jaxen are available
XPathParseException
- if the given expression cannot be parsed
createXPathExpression
public static XPathExpression createXPathExpression(String expression,
Map<String,String> namespaces)
throws IllegalStateException,
XPathParseException
- Create a compiled XPath expression using the given string and namespaces. The namespace map should consist of
string prefixes mapped to string namespaces.
- Parameters:
expression
- the XPath expressionnamespaces
- a map that binds string prefixes to string namespaces
- Returns:
- the compiled XPath expression
- Throws:
IllegalStateException
- if neither JAXP 1.3+, or Jaxen are available
XPathParseException
- if the given expression cannot be parsed
Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.