javax.xml.xpath

Class XPathFactory

Known Direct Subclasses:
XPathFactoryImpl

public abstract class XPathFactory
extends java.lang.Object

Factory for creating XPath environments.

Since:
1.3

Field Summary

static String
DEFAULT_OBJECT_MODEL_URI
The default object model URI.
static String
DEFAULT_PROPERTY_NAME
The default property name according to the JAXP specification.

Constructor Summary

XPathFactory()

Method Summary

boolean
getFeature(String name)
Returns the state of the named feature.
boolean
isObjectModelSupported(String objectModel)
Indicates whether the specified object model URI is supported by this factory.
static XPathFactory
newInstance()
Returns a new factory for the default (DOM) object model.
static XPathFactory
newInstance(String uri)
Returns a new factory for the given object model URI.
XPath
newXPath()
Returns a new XPath evaluation environment.
void
setFeature(String name, boolean value)
Sets the state of the named feature.
void
setXPathFunctionResolver(XPathFunctionResolver resolver)
Sets the XPath extension function resolver calback.
void
setXPathVariableResolver(XPathVariableResolver resolver)
Sets the XPath variable resolver calback.

Field Details

DEFAULT_OBJECT_MODEL_URI

public static final String DEFAULT_OBJECT_MODEL_URI
The default object model URI.


DEFAULT_PROPERTY_NAME

public static final String DEFAULT_PROPERTY_NAME
The default property name according to the JAXP specification.

Constructor Details

XPathFactory

protected XPathFactory()

Method Details

getFeature

public boolean getFeature(String name)
            throws XPathFactoryConfigurationException
Returns the state of the named feature.


isObjectModelSupported

public boolean isObjectModelSupported(String objectModel)
Indicates whether the specified object model URI is supported by this factory.


newInstance

public static final XPathFactory newInstance()
Returns a new factory for the default (DOM) object model.


newInstance

public static final XPathFactory newInstance(String uri)
            throws XPathFactoryConfigurationException
Returns a new factory for the given object model URI. The implementation class to load is the first found in the following locations that advertises support for the given model URI:
  1. the javax.xml.xpath.XPathFactory system property
  2. the above named property value in the $JAVA_HOME/lib/jaxp.properties file
  3. the class name specified in the META-INF/services/javax.xml.xpath.XPathFactory system resource
  4. the default factory class

Parameters:
uri - the object model URI


newXPath

public XPath newXPath()
Returns a new XPath evaluation environment.


setFeature

public void setFeature(String name,
                       boolean value)
            throws XPathFactoryConfigurationException
Sets the state of the named feature.


setXPathFunctionResolver

public void setXPathFunctionResolver(XPathFunctionResolver resolver)
Sets the XPath extension function resolver calback.


setXPathVariableResolver

public void setXPathVariableResolver(XPathVariableResolver resolver)
Sets the XPath variable resolver calback.