org.apache.xpath.jaxp

Class XPathFactoryImpl

public class XPathFactoryImpl extends XPathFactory

The XPathFactory builds XPaths.

Version: $Revision: 1.1 $

Author: Ramesh Mandava

Method Summary
booleangetFeature(String name)

Get the state of the named feature.

Feature names are fully qualified {@link java.net.URI}s.

booleanisObjectModelSupported(String objectModel)

Is specified object model supported by this XPathFactory?

XPathnewXPath()

Returns a new XPath object using the underlying object model determined when the factory was instantiated.

voidsetFeature(String name, boolean value)

Set a feature for this XPathFactory and XPaths created by this factory.

Feature names are fully qualified {@link java.net.URI}s.

voidsetXPathFunctionResolver(XPathFunctionResolver resolver)

Establish a default function resolver.

Any XPath objects constructed from this factory will use the specified resolver by default.

A NullPointerException is thrown if resolver is null.

voidsetXPathVariableResolver(XPathVariableResolver resolver)

Establish a default variable resolver.

Any XPath objects constructed from this factory will use the specified resolver by default.

A NullPointerException is thrown if resolver is null.

Method Detail

getFeature

public boolean getFeature(String name)

Get the state of the named feature.

Feature names are fully qualified {@link java.net.URI}s. Implementations may define their own features. An {@link XPathFactoryConfigurationException} is thrown if this XPathFactory or the XPaths it creates cannot support the feature. It is possible for an XPathFactory to expose a feature value but be unable to change its state.

Parameters: name Feature name.

Returns: State of the named feature.

Throws: XPathFactoryConfigurationException if this XPathFactory or the XPaths it creates cannot support this feature. NullPointerException if name is null.

isObjectModelSupported

public boolean isObjectModelSupported(String objectModel)

Is specified object model supported by this XPathFactory?

Parameters: objectModel Specifies the object model which the returned XPathFactory will understand.

Returns: true if XPathFactory supports objectModel, else false.

Throws: NullPointerException If objectModel is null. IllegalArgumentException If objectModel.length() == 0.

newXPath

public XPath newXPath()

Returns a new XPath object using the underlying object model determined when the factory was instantiated.

Returns: New XPath

setFeature

public void setFeature(String name, boolean value)

Set a feature for this XPathFactory and XPaths created by this factory.

Feature names are fully qualified {@link java.net.URI}s. Implementations may define their own features. An {@link XPathFactoryConfigurationException} is thrown if this XPathFactory or the XPaths it creates cannot support the feature. It is possible for an XPathFactory to expose a feature value but be unable to change its state.

See {@link javax.xml.xpath.XPathFactory} for full documentation of specific features.

Parameters: name Feature name. value Is feature state true or false.

Throws: XPathFactoryConfigurationException if this XPathFactory or the XPaths it creates cannot support this feature. NullPointerException if name is null.

setXPathFunctionResolver

public void setXPathFunctionResolver(XPathFunctionResolver resolver)

Establish a default function resolver.

Any XPath objects constructed from this factory will use the specified resolver by default.

A NullPointerException is thrown if resolver is null.

Parameters: resolver XPath function resolver.

Throws: NullPointerException If resolver is null.

setXPathVariableResolver

public void setXPathVariableResolver(XPathVariableResolver resolver)

Establish a default variable resolver.

Any XPath objects constructed from this factory will use the specified resolver by default.

A NullPointerException is thrown if resolver is null.

Parameters: resolver Variable resolver.

Throws: NullPointerException If resolver is null.

Copyright B) 2005 Apache XML Project. All Rights Reserved.