org.apache.excalibur.xml.xpath
Class XPathProcessorImpl
java.lang.Object
|
+--org.apache.avalon.framework.logger.AbstractLogEnabled
|
+--org.apache.excalibur.xml.xpath.AbstractProcessorImpl
|
+--org.apache.excalibur.xml.xpath.XPathProcessorImpl
- All Implemented Interfaces:
- Component, Configurable, LogEnabled, PrefixResolver, ThreadSafe, XPathProcessor
- public final class XPathProcessorImpl
- extends AbstractProcessorImpl
- implements XPathProcessor, Configurable, Component, ThreadSafe
This class defines the implementation of the XPathProcessor
component.
To configure it, add the following lines in the
cocoon.xconf file:
<xpath-processor class="org.apache.cocoon.components.xpath.XPathProcessorImpl">
</xpath-processor>
- Version:
- CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:15 $ $Author: cziegeler $
- Author:
- Avalon Development Team
Method Summary |
void |
configure(Configuration configuration)
|
boolean |
evaluateAsBoolean(Node contextNode,
String str,
PrefixResolver resolver)
Evaluate XPath expression within a context. |
Number |
evaluateAsNumber(Node contextNode,
String str,
PrefixResolver resolver)
Evaluate XPath expression within a context. |
String |
evaluateAsString(Node contextNode,
String str,
PrefixResolver resolver)
Evaluate XPath expression within a context. |
NodeList |
selectNodeList(Node contextNode,
String str,
PrefixResolver resolver)
Use an XPath string to select a nodelist. |
Node |
selectSingleNode(Node contextNode,
String str,
PrefixResolver resolver)
Use an XPath string to select a single node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XPathProcessorImpl
public XPathProcessorImpl()
configure
public void configure(Configuration configuration)
throws ConfigurationException
- Specified by:
configure
in interface Configurable
- Overrides:
configure
in class AbstractProcessorImpl
ConfigurationException
evaluateAsBoolean
public boolean evaluateAsBoolean(Node contextNode,
String str,
PrefixResolver resolver)
- Evaluate XPath expression within a context.
- Specified by:
evaluateAsBoolean
in interface XPathProcessor
- Specified by:
evaluateAsBoolean
in class AbstractProcessorImpl
- Parameters:
contextNode
- The context node.str
- A valid XPath string.resolver
- a PrefixResolver, used for resolving namespace prefixes
- Returns:
- expression result as boolean.
evaluateAsNumber
public Number evaluateAsNumber(Node contextNode,
String str,
PrefixResolver resolver)
- Evaluate XPath expression within a context.
- Specified by:
evaluateAsNumber
in interface XPathProcessor
- Specified by:
evaluateAsNumber
in class AbstractProcessorImpl
- Parameters:
contextNode
- The context node.str
- A valid XPath string.resolver
- a PrefixResolver, used for resolving namespace prefixes
- Returns:
- expression result as number.
evaluateAsString
public String evaluateAsString(Node contextNode,
String str,
PrefixResolver resolver)
- Evaluate XPath expression within a context.
- Specified by:
evaluateAsString
in interface XPathProcessor
- Specified by:
evaluateAsString
in class AbstractProcessorImpl
- Parameters:
contextNode
- The context node.str
- A valid XPath string.resolver
- a PrefixResolver, used for resolving namespace prefixes
- Returns:
- expression result as string.
selectSingleNode
public Node selectSingleNode(Node contextNode,
String str,
PrefixResolver resolver)
- Use an XPath string to select a single node.
- Specified by:
selectSingleNode
in interface XPathProcessor
- Specified by:
selectSingleNode
in class AbstractProcessorImpl
- Parameters:
contextNode
- The node to start searching from.str
- A valid XPath string.resolver
- a PrefixResolver, used for resolving namespace prefixes
- Returns:
- The first node found that matches the XPath, or null.
selectNodeList
public NodeList selectNodeList(Node contextNode,
String str,
PrefixResolver resolver)
- Use an XPath string to select a nodelist.
- Specified by:
selectNodeList
in interface XPathProcessor
- Specified by:
selectNodeList
in class AbstractProcessorImpl
- Parameters:
contextNode
- The node to start searching from.str
- A valid XPath string.resolver
- a PrefixResolver, used for resolving namespace prefixes
- Returns:
- A List, should never be null.
Copyright © 1997-2004 The Apache Software Foundation. All Rights Reserved.