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

pack-priv Class XPathImplUtil

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xpath.internal.jaxp.XPathExpressionImpl, com.sun.org.apache.xpath.internal.jaxp.XPathImpl
Imports
com.sun.org.apache.xalan.internal.res.XSLMessages, com.sun.org.apache.xml.internal.dtm.DTM, com.sun.org.apache.xpath.internal.axes.LocPathIterator, com.sun.org.apache.xpath.internal.objects.XObject, com.sun.org.apache.xpath.internal.res.XPATHErrorResources, java.io.IOException, javax.xml.XMLConstants, javax.xml.namespace.QName, javax.xml.parsers.DocumentBuilderFactory, .ParserConfigurationException, javax.xml.transform.TransformerException, javax.xml.xpath.XPathConstants, .XPathEvaluationResult, .XPathExpressionException, .XPathFunctionResolver, .XPathNodes, .XPathVariableResolver, jdk.xml.internal.JdkXmlFeatures, .JdkXmlUtils, .XMLSecurityManager, .XMLSecurityPropertyManager, org.w3c.dom.Document, .Node, org.w3c.dom.traversal.NodeIterator, org.xml.sax.InputSource, .SAXException

This class contains several utility methods used by XPathImpl and XPathExpressionImpl

Field Summary

Modifier and TypeField and Description
pack-priv JdkXmlFeatures
pack-priv boolean
pack-priv XPathFunctionResolver
pack-priv boolean
pack-priv JAXPPrefixResolver
pack-priv XPathVariableResolver
pack-priv XMLSecurityManager
pack-priv XMLSecurityPropertyManager

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv XObject

Returns:

an XObject
eval
(Object
The XPath context
contextItem
,
XPath
The internal XPath engine
xpath
)

Evaluate an XPath context using the internal XPath engine

pack-priv Document

Returns:

a DOM Document
getDocument
(InputSource
The InputSource of the document
source
)

Parse the input source and return a Document.

pack-priv Object

Returns:

result per the return type
getResultAsType
(XObject
the result of an evaluation
resultObject
,
QName
the return type
returnType
)

Get result depending on the QName type defined in XPathConstants

pack-priv <
The class type
T
>
T

Returns:

an instance of the specified type or null if the XObject returned an UNKNOWN object type.
getXPathResult
(XObject
the result of an evaluation
resultObject
,
Class<T>
The class type expected to be returned by the XPath expression.
type
)

Construct an XPathExpressionResult object based on the result of the evaluation and cast to the specified class type.

pack-priv void
isSupported(QName
the return type
returnType
)

Check if the requested returnType is supported.

pack-priv <
The class type
T
>
void
isSupportedClassType(Class<T>
The type to be checked
type
)

Check whether or not the specified type is supported

pack-priv <
the type of the reference
T
>
void
requireNonNull(T
the parameter to check for nullity
param
,
String
the parameter name
paramName
)

Checks that the specified parameter is not null.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

featureManagerback to summary
pack-priv JdkXmlFeatures featureManager
featureSecureProcessingback to summary
pack-priv boolean featureSecureProcessing
functionResolverback to summary
pack-priv XPathFunctionResolver functionResolver
overrideDefaultParserback to summary
pack-priv boolean overrideDefaultParser
prefixResolverback to summary
pack-priv JAXPPrefixResolver prefixResolver
variableResolverback to summary
pack-priv XPathVariableResolver variableResolver
xmlSecMgrback to summary
pack-priv XMLSecurityManager xmlSecMgr
xmlSecPropMgrback to summary
pack-priv XMLSecurityPropertyManager xmlSecPropMgr

Constructor Detail

XPathImplUtilback to summary
pack-priv XPathImplUtil()

Method Detail

evalback to summary
pack-priv XObject eval(Object contextItem, XPath xpath) throws TransformerException

Evaluate an XPath context using the internal XPath engine

Parameters
contextItem:Object

The XPath context

xpath:XPath

The internal XPath engine

Returns:XObject

an XObject

Exceptions
TransformerException:
If the expression cannot be evaluated.
getDocumentback to summary
pack-priv Document getDocument(InputSource source) throws XPathExpressionException

Parse the input source and return a Document.

Parameters
source:InputSource

The InputSource of the document

Returns:Document

a DOM Document

Exceptions
XPathExpressionException:
if there is an error parsing the source.
getResultAsTypeback to summary
pack-priv Object getResultAsType(XObject resultObject, QName returnType) throws TransformerException

Get result depending on the QName type defined in XPathConstants

Parameters
resultObject:XObject

the result of an evaluation

returnType:QName

the return type

Returns:Object

result per the return type

Exceptions
TransformerException:
if the result can not be converted to the specified return type.
getXPathResultback to summary
pack-priv <T> T getXPathResult(XObject resultObject, Class<T> type) throws TransformerException

Construct an XPathExpressionResult object based on the result of the evaluation and cast to the specified class type.

Parameters
<T>
The class type
resultObject:XObject

the result of an evaluation

type:Class<T>

The class type expected to be returned by the XPath expression.

Returns:T

an instance of the specified type or null if the XObject returned an UNKNOWN object type.

Exceptions
TransformerException:
if there is an error converting the result to the specified type. It's unlikely to happen. This is mostly needed by the internal XPath engine.
isSupportedback to summary
pack-priv void isSupported(QName returnType)

Check if the requested returnType is supported.

Parameters
returnType:QName

the return type

Exceptions
IllegalArgumentException:
if the return type is not supported
isSupportedClassTypeback to summary
pack-priv <T> void isSupportedClassType(Class<T> type)

Check whether or not the specified type is supported

Parameters
<T>
The class type
type:Class<T>

The type to be checked

Exceptions
IllegalArgumentException:
if the type is not supported
requireNonNullback to summary
pack-priv <T> void requireNonNull(T param, String paramName)

Checks that the specified parameter is not null.

Parameters
<T>
the type of the reference
param:T

the parameter to check for nullity

paramName:String

the parameter name

Exceptions
NullPointerException:
if param is null