public abstract class XPathExpressionFactory extends Object
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.
XPathExpression
Constructor and Description |
---|
XPathExpressionFactory() |
Modifier and Type | Method and Description |
---|---|
static XPathExpression |
createXPathExpression(String expression)
Create a compiled XPath expression using the given string.
|
static XPathExpression |
createXPathExpression(String expression,
Map<String,String> namespaces)
Create a compiled XPath expression using the given string and namespaces.
|
public static XPathExpression createXPathExpression(String expression) throws IllegalStateException, XPathParseException
expression
- the XPath expressionIllegalStateException
- if neither JAXP 1.3+, or Jaxen are availableXPathParseException
- if the given expression cannot be parsedpublic static XPathExpression createXPathExpression(String expression, Map<String,String> namespaces) throws IllegalStateException, XPathParseException
expression
- the XPath expressionnamespaces
- a map that binds string prefixes to string namespacesIllegalStateException
- if neither JAXP 1.3+, or Jaxen are availableXPathParseException
- if the given expression cannot be parsed