public class ThreadLocalXPathExpression extends ThreadLocal<XPathExpression> implements XPathExpression
Constructor and Description |
---|
ThreadLocalXPathExpression(String xPath,
NamespaceContext context)
Creates a new instance from an XPath expression and namespace context.
|
Modifier and Type | Method and Description |
---|---|
String |
evaluate(InputSource inputSource) |
Object |
evaluate(InputSource inputSource,
QName qName) |
String |
evaluate(Object o) |
Object |
evaluate(Object o,
QName qName) |
NodeList |
evaluateAsNodeList(Object o)
Evaluates the XPath expression and returns the result coerced to a node list.
|
String |
evaluateAsString(Object o)
Evaluates the XPath expression and returns the result coerced to a string.
|
protected XPathExpression |
initialValue() |
get, remove, set, withInitial
public ThreadLocalXPathExpression(String xPath, NamespaceContext context)
xPath
- XPath expression.context
- Namespace context for handling namespace prefix to URI mappings.public Object evaluate(Object o, QName qName) throws XPathExpressionException
evaluate
in interface XPathExpression
XPathExpressionException
public String evaluate(Object o) throws XPathExpressionException
evaluate
in interface XPathExpression
XPathExpressionException
public Object evaluate(InputSource inputSource, QName qName) throws XPathExpressionException
evaluate
in interface XPathExpression
XPathExpressionException
public String evaluate(InputSource inputSource) throws XPathExpressionException
evaluate
in interface XPathExpression
XPathExpressionException
public String evaluateAsString(Object o) throws XPathExpressionException
o
- Object on which to evaluate the expression; typically a DOM node.XPathExpressionException
- On XPath evaluation errors.public NodeList evaluateAsNodeList(Object o) throws XPathExpressionException
o
- Object on which to evaluate the expression; typically a DOM node.XPathExpressionException
- On XPath evaluation errors.protected XPathExpression initialValue()
initialValue
in class ThreadLocal<XPathExpression>
Copyright © 2006–2017 Jasig. All rights reserved.