Class XPathFactoryImpl
- java.lang.Object
-
- javax.xml.xpath.XPathFactory
-
- org.apache.xpath.jaxp.XPathFactoryImpl
-
public class XPathFactoryImpl extends javax.xml.xpath.XPathFactory
The XPathFactory builds XPaths.- Version:
- $Revision: 1225277 $
- Author:
- Ramesh Mandava
-
-
Constructor Summary
Constructors Constructor Description XPathFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getFeature(java.lang.String name)
Get the state of the named feature.boolean
isObjectModelSupported(java.lang.String objectModel)
Is specified object model supported by thisXPathFactory
?javax.xml.xpath.XPath
newXPath()
Returns a newXPath
object using the underlying object model determined when the factory was instantiated.void
setFeature(java.lang.String name, boolean value)
Set a feature for thisXPathFactory
andXPath
s created by this factory.void
setXPathFunctionResolver(javax.xml.xpath.XPathFunctionResolver resolver)
Establish a default function resolver.void
setXPathVariableResolver(javax.xml.xpath.XPathVariableResolver resolver)
Establish a default variable resolver.
-
-
-
Method Detail
-
isObjectModelSupported
public boolean isObjectModelSupported(java.lang.String objectModel)
Is specified object model supported by this
XPathFactory
?- Specified by:
isObjectModelSupported
in classjavax.xml.xpath.XPathFactory
- Parameters:
objectModel
- Specifies the object model which the returnedXPathFactory
will understand.- Returns:
true
ifXPathFactory
supportsobjectModel
, elsefalse
.- Throws:
java.lang.NullPointerException
- IfobjectModel
isnull
.java.lang.IllegalArgumentException
- IfobjectModel.length() == 0
.
-
newXPath
public javax.xml.xpath.XPath newXPath()
Returns a new
XPath
object using the underlying object model determined when the factory was instantiated.- Specified by:
newXPath
in classjavax.xml.xpath.XPathFactory
- Returns:
- New
XPath
-
setFeature
public void setFeature(java.lang.String name, boolean value) throws javax.xml.xpath.XPathFactoryConfigurationException
Set a feature for this
XPathFactory
andXPath
s created by this factory.Feature names are fully qualified
URI
s. Implementations may define their own features. AnXPathFactoryConfigurationException
is thrown if thisXPathFactory
or theXPath
s it creates cannot support the feature. It is possible for anXPathFactory
to expose a feature value but be unable to change its state.See
XPathFactory
for full documentation of specific features.- Specified by:
setFeature
in classjavax.xml.xpath.XPathFactory
- Parameters:
name
- Feature name.value
- Is feature statetrue
orfalse
.- Throws:
javax.xml.xpath.XPathFactoryConfigurationException
- if thisXPathFactory
or theXPath
s it creates cannot support this feature.java.lang.NullPointerException
- ifname
isnull
.
-
getFeature
public boolean getFeature(java.lang.String name) throws javax.xml.xpath.XPathFactoryConfigurationException
Get the state of the named feature.
Feature names are fully qualified
URI
s. Implementations may define their own features. AnXPathFactoryConfigurationException
is thrown if thisXPathFactory
or theXPath
s it creates cannot support the feature. It is possible for anXPathFactory
to expose a feature value but be unable to change its state.- Specified by:
getFeature
in classjavax.xml.xpath.XPathFactory
- Parameters:
name
- Feature name.- Returns:
- State of the named feature.
- Throws:
javax.xml.xpath.XPathFactoryConfigurationException
- if thisXPathFactory
or theXPath
s it creates cannot support this feature.java.lang.NullPointerException
- ifname
isnull
.
-
setXPathFunctionResolver
public void setXPathFunctionResolver(javax.xml.xpath.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 ifresolver
isnull
.- Specified by:
setXPathFunctionResolver
in classjavax.xml.xpath.XPathFactory
- Parameters:
resolver
- XPath function resolver.- Throws:
java.lang.NullPointerException
- Ifresolver
isnull
.
-
setXPathVariableResolver
public void setXPathVariableResolver(javax.xml.xpath.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 ifresolver
isnull
.- Specified by:
setXPathVariableResolver
in classjavax.xml.xpath.XPathFactory
- Parameters:
resolver
- Variable resolver.- Throws:
java.lang.NullPointerException
- Ifresolver
isnull
.
-
-