APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xpath.internal.jaxp

public Class XPathExpressionImpl

extends XPathImplUtil
implements XPathExpression
Class Inheritance
All Implemented Interfaces
javax.xml.xpath.XPathExpression
Imports
com.sun.org.apache.xml.internal.utils.WrappedRuntimeException, com.sun.org.apache.xpath.internal.objects.XObject, javax.xml.namespace.QName, javax.xml.transform.TransformerException, javax.xml.xpath.XPathConstants, .XPathEvaluationResult, .XPathExpression, .XPathExpressionException, .XPathFunctionException, .XPathFunctionResolver, .XPathVariableResolver, jdk.xml.internal.JdkXmlConfig, .JdkXmlFeatures, .XMLSecurityManager, .XMLSecurityPropertyManager, org.w3c.dom.Document, org.xml.sax.InputSource

The XPathExpression interface encapsulates a (compiled) XPath expression.
Author
Ramesh Mandava

Field Summary

Modifier and TypeField and Description
private XPath
Inherited from com.sun.org.apache.xpath.internal.jaxp.XPathImplUtil:
featureManagerfeatureSecureProcessingfunctionResolveroverrideDefaultParserprefixResolvervariableResolverxmlSecMgrxmlSecPropMgr

Constructor Summary

AccessConstructor and Description
protected
XPathExpressionImpl()

Protected constructor to prevent direct instantiation; use compile() from the context.

protected
XPathExpressionImpl(XPath xpath, JAXPPrefixResolver prefixResolver, XPathFunctionResolver functionResolver, XPathVariableResolver variableResolver)

protected
XPathExpressionImpl(XPath xpath, JAXPPrefixResolver prefixResolver, XPathFunctionResolver functionResolver, XPathVariableResolver variableResolver, boolean featureSecureProcessing, JdkXmlFeatures featureManager, XMLSecurityManager xmlSecMgr, XMLSecurityPropertyManager xmlSecPropMgr)

Method Summary

Modifier and TypeMethod and Description
public Object
eval(Object item, QName returnType)

public Object
evaluate(Object item, QName returnType)

Implements javax.xml.xpath.XPathExpression.evaluate.

Evaluate the compiled XPath expression in the specified context and return the result as the specified type.

public String
evaluate(Object item)

Implements javax.xml.xpath.XPathExpression.evaluate.

Evaluate the compiled XPath expression in the specified context and return the result as a String.

public Object
evaluate(InputSource source, QName returnType)

Implements javax.xml.xpath.XPathExpression.evaluate.

Evaluate the compiled XPath expression in the context of the specified InputSource and return the result as the specified type.

public String
evaluate(InputSource source)

Implements javax.xml.xpath.XPathExpression.evaluate.

Evaluate the compiled XPath expression in the context of the specified InputSource and return the result as a String.

public <T> T
evaluateExpression(Object item, Class<T> type)

Overrides default javax.xml.xpath.XPathExpression.evaluateExpression.

Evaluate the compiled XPath expression in the specified context, and return the result with the type specified through the class type.

public XPathEvaluationResult<?>
evaluateExpression(Object item)

Overrides default javax.xml.xpath.XPathExpression.evaluateExpression.

Evaluate the compiled XPath expression in the specified context.

public <T> T
evaluateExpression(InputSource source, Class<T> type)

Overrides default javax.xml.xpath.XPathExpression.evaluateExpression.

Evaluate the compiled XPath expression in the specified context, and return the result with the type specified through the class type

This method builds a data model for the InputSource and calls evaluateExpression(Object item, Class type) on the resulting document object.

public XPathEvaluationResult<?>
evaluateExpression(InputSource source)

Overrides default javax.xml.xpath.XPathExpression.evaluateExpression.

Evaluate the compiled XPath expression in the specified context.

public void
setXPath(XPath xpath)

Inherited from com.sun.org.apache.xpath.internal.jaxp.XPathImplUtil:
evalgetDocumentgetResultAsTypegetXPathResultisSupportedisSupportedClassTyperequireNonNull

Field Detail

xpathback to summary
private XPath xpath

Constructor Detail

XPathExpressionImplback to summary
protected XPathExpressionImpl()

Protected constructor to prevent direct instantiation; use compile() from the context.

XPathExpressionImplback to summary
protected XPathExpressionImpl(XPath xpath, JAXPPrefixResolver prefixResolver, XPathFunctionResolver functionResolver, XPathVariableResolver variableResolver)
XPathExpressionImplback to summary
protected XPathExpressionImpl(XPath xpath, JAXPPrefixResolver prefixResolver, XPathFunctionResolver functionResolver, XPathVariableResolver variableResolver, boolean featureSecureProcessing, JdkXmlFeatures featureManager, XMLSecurityManager xmlSecMgr, XMLSecurityPropertyManager xmlSecPropMgr)

Method Detail

evalback to summary
public Object eval(Object item, QName returnType) throws TransformerException
evaluateback to summary
public Object evaluate(Object item, QName returnType) throws XPathExpressionException

Implements javax.xml.xpath.XPathExpression.evaluate.

Doc from javax.xml.xpath.XPathExpression.evaluate.

Evaluate the compiled XPath expression in the specified context and return the result as the specified type.

See Evaluation of XPath Expressions for context item evaluation, variable, function and QName resolution and return type conversion.

The parameter item represents the context the XPath expression will be operated on. The type of the context is implementation-dependent. If the value is null, the operation must have no dependency on the context, otherwise an XPathExpressionException will be thrown.

Annotations
@Override
Exceptions
XPathExpressionException:
If the expression cannot be evaluated.
evaluateback to summary
public String evaluate(Object item) throws XPathExpressionException

Implements javax.xml.xpath.XPathExpression.evaluate.

Doc from javax.xml.xpath.XPathExpression.evaluate.

Evaluate the compiled XPath expression in the specified context and return the result as a String.

This method calls evaluate(Object item, QName returnType) with a returnType of XPathConstants#STRING.

See Evaluation of XPath Expressions for context item evaluation, variable, function and QName resolution and return type conversion.

The parameter item represents the context the XPath expression will be operated on. The type of the context is implementation-dependent. If the value is null, the operation must have no dependency on the context, otherwise an XPathExpressionException will be thrown.

Annotations
@Override
Exceptions
XPathExpressionException:
If the expression cannot be evaluated.
evaluateback to summary
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException

Implements javax.xml.xpath.XPathExpression.evaluate.

Doc from javax.xml.xpath.XPathExpression.evaluate.

Evaluate the compiled XPath expression in the context of the specified InputSource and return the result as the specified type.

This method builds a data model for the InputSource and calls evaluate(Object item, QName returnType) on the resulting document object.

See Evaluation of XPath Expressions for context item evaluation, variable, function and QName resolution and return type conversion.

If returnType is not one of the types defined in XPathConstants, then an IllegalArgumentException is thrown.

If source or returnType is null, then a NullPointerException is thrown.

Annotations
@Override
Exceptions
XPathExpressionException:
If the expression cannot be evaluated.
evaluateback to summary
public String evaluate(InputSource source) throws XPathExpressionException

Implements javax.xml.xpath.XPathExpression.evaluate.

Doc from javax.xml.xpath.XPathExpression.evaluate.

Evaluate the compiled XPath expression in the context of the specified InputSource and return the result as a String.

This method calls evaluate(InputSource source, QName returnType) with a returnType of XPathConstants#STRING.

See Evaluation of XPath Expressions for context item evaluation, variable, function and QName resolution and return type conversion.

If source is null, then a NullPointerException is thrown.

Annotations
@Override
Exceptions
XPathExpressionException:
If the expression cannot be evaluated.
evaluateExpressionback to summary
public <T> T evaluateExpression(Object item, Class<T> type) throws XPathExpressionException

Overrides default javax.xml.xpath.XPathExpression.evaluateExpression.

Doc from javax.xml.xpath.XPathExpression.evaluateExpression.

Evaluate the compiled XPath expression in the specified context, and return the result with the type specified through the class type.

The parameter item represents the context the XPath expression will be operated on. The type of the context is implementation-dependent. If the value is null, the operation must have no dependency on the context, otherwise an XPathExpressionException will be thrown.

Annotations
@Override
Exceptions
XPathExpressionException:
If the expression cannot be evaluated.
evaluateExpressionback to summary
public XPathEvaluationResult<?> evaluateExpression(Object item) throws XPathExpressionException

Overrides default javax.xml.xpath.XPathExpression.evaluateExpression.

Doc from javax.xml.xpath.XPathExpression.evaluateExpression.

Evaluate the compiled XPath expression in the specified context. This is equivalent to calling evaluateExpression(Object item, Class type) with type XPathEvaluationResult:

 evaluateExpression(item, XPathEvaluationResult.class);

The parameter item represents the context the XPath expression will be operated on. The type of the context is implementation-dependent. If the value is null, the operation must have no dependency on the context, otherwise an XPathExpressionException will be thrown.

Annotations
@Override
Exceptions
XPathExpressionException:
If the expression cannot be evaluated.
evaluateExpressionback to summary
public <T> T evaluateExpression(InputSource source, Class<T> type) throws XPathExpressionException

Overrides default javax.xml.xpath.XPathExpression.evaluateExpression.

Doc from javax.xml.xpath.XPathExpression.evaluateExpression.

Evaluate the compiled XPath expression in the specified context, and return the result with the type specified through the class type

This method builds a data model for the InputSource and calls evaluateExpression(Object item, Class type) on the resulting document object.

By default, the JDK's data model is org.w3c.dom.Document.

Annotations
@Override
Exceptions
XPathExpressionException:
If the expression cannot be evaluated.
evaluateExpressionback to summary
public XPathEvaluationResult<?> evaluateExpression(InputSource source) throws XPathExpressionException

Overrides default javax.xml.xpath.XPathExpression.evaluateExpression.

Doc from javax.xml.xpath.XPathExpression.evaluateExpression.

Evaluate the compiled XPath expression in the specified context. This is equivalent to calling evaluateExpression(InputSource source, Class type) with type XPathEvaluationResult:

 evaluateExpression(source, XPathEvaluationResult.class);
Annotations
@Override
Exceptions
XPathExpressionException:
If the expression cannot be evaluated.
setXPathback to summary
public void setXPath(XPath xpath)