| java.lang.Object org.jdom.xpath.XPath org.jdom.xpath.JaxenXPath
JaxenXPath | class JaxenXPath extends XPath (Code) | | A non-public concrete XPath implementation for Jaxen.
version: $Revision: 1.2 $, $Date: 2005/05/03 07:02:04 $ author: Laurent Bihanic |
Constructor Summary | |
public | JaxenXPath(String expr) Creates a new XPath wrapper object, compiling the specified
XPath expression. |
Method Summary | |
public void | addNamespace(Namespace namespace) Adds a namespace definition to the list of namespaces known of
this XPath expression.
Note: In XPath, there is no such thing as a
'default namespace'. | public boolean | equals(Object o) | public String | getXPath() Returns the wrapped XPath expression as a string. | public int | hashCode() | public Number | numberValueOf(Object context) Returns the number value of the first item selected by applying
the wrapped XPath expression to the given context.
Parameters: context - the element to use as context for evaluatingthe XPath expression. | public List | selectNodes(Object context) Evaluates the wrapped XPath expression and returns the list
of selected items.
Parameters: context - the node to use as context for evaluatingthe XPath expression. | public Object | selectSingleNode(Object context) Evaluates the wrapped XPath expression and returns the first
entry in the list of selected nodes (or atomics).
Parameters: context - the node to use as context for evaluatingthe XPath expression. | public void | setVariable(String name, Object value) Defines an XPath variable and sets its value. | public String | toString() | public String | valueOf(Object context) Returns the string value of the first node selected by applying
the wrapped XPath expression to the given context.
Parameters: context - the element to use as context for evaluatingthe XPath expression. |
JaxenXPath | public JaxenXPath(String expr) throws JDOMException(Code) | | Creates a new XPath wrapper object, compiling the specified
XPath expression.
Parameters: expr - the XPath expression to wrap. throws: JDOMException - if the XPath expression is invalid. |
addNamespace | public void addNamespace(Namespace namespace)(Code) | | Adds a namespace definition to the list of namespaces known of
this XPath expression.
Note: In XPath, there is no such thing as a
'default namespace'. The empty prefix always resolves
to the empty namespace URI.
Parameters: namespace - the namespace. |
getXPath | public String getXPath()(Code) | | Returns the wrapped XPath expression as a string.
the wrapped XPath expression as a string. |
hashCode | public int hashCode()(Code) | | |
numberValueOf | public Number numberValueOf(Object context) throws JDOMException(Code) | | Returns the number value of the first item selected by applying
the wrapped XPath expression to the given context.
Parameters: context - the element to use as context for evaluatingthe XPath expression. the number value of the first item selected by applyingthe wrapped XPath expression to the given context,null if no node was selected or thespecial value java.lang.Double.NaN(NotElement-a-Number) if the selected value can not beconverted into a number value. throws: JDOMException - if the XPath expression is invalid orits evaluation on the specified contextfailed. |
selectNodes | public List selectNodes(Object context) throws JDOMException(Code) | | Evaluates the wrapped XPath expression and returns the list
of selected items.
Parameters: context - the node to use as context for evaluatingthe XPath expression. the list of selected items, which may be of types: Element,Attribute, Text, CDATA,Comment, ProcessingInstruction, Boolean,Double, or String. throws: JDOMException - if the evaluation of the XPathexpression on the specified contextfailed. |
selectSingleNode | public Object selectSingleNode(Object context) throws JDOMException(Code) | | Evaluates the wrapped XPath expression and returns the first
entry in the list of selected nodes (or atomics).
Parameters: context - the node to use as context for evaluatingthe XPath expression. the first selected item, which may be of types: Element,Attribute, Text, CDATA,Comment, ProcessingInstruction, Boolean,Double, String, or null if no item was selected. throws: JDOMException - if the evaluation of the XPathexpression on the specified contextfailed. |
setVariable | public void setVariable(String name, Object value) throws IllegalArgumentException(Code) | | Defines an XPath variable and sets its value.
Parameters: name - the variable name. Parameters: value - the variable value. throws: IllegalArgumentException - if name is nota valid XPath variable nameor if the value type is notsupported by the underlyingimplementation |
valueOf | public String valueOf(Object context) throws JDOMException(Code) | | Returns the string value of the first node selected by applying
the wrapped XPath expression to the given context.
Parameters: context - the element to use as context for evaluatingthe XPath expression. the string value of the first node selected by applyingthe wrapped XPath expression to the given context. throws: JDOMException - if the XPath expression is invalid orits evaluation on the specified contextfailed. |
|
|