Deprecated
replaced by compiled version.
| Modifier and Type | Field and Description |
|---|---|
| private final JDOMNavigator | navigator
The current context for XPath expression evaluation. |
| private static final long | serialVersionUID
Default mechanism.
|
| private transient XPath | xPath
The compiled XPath object to select nodes. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addNamespace(Namespace
the namespace. namespace)Implements abstract org. |
| public String | Returns: the wrapped XPath expression as a string.Implements abstract org. |
| public Number | Returns: the number value of the first item selected by applying the wrapped XPath expression to the given context,null
if no node was selected or the special value
java. (Not-a-Number) if the selected value
can not be converted into a number value.the element to use as context for evaluating the XPath expression. context)Implements abstract org. |
| public List | selectNodes(Object
the node to use as context for evaluating the XPath expression. context)Implements abstract org. |
| public Object | selectSingleNode(Object
the node to use as context for evaluating the XPath expression. context)Implements abstract org. |
| public void | setVariable(String
the variable name. name, Object the variable value. value)Implements abstract org. |
| private void | |
| public String | |
| private static final List | |
| private static final Object | |
| public String | Returns: the string value of the first node selected by applying the wrapped XPath expression to the given context.the element to use as context for evaluating the XPath expression. context)Implements abstract org. |
| navigator | back to summary |
|---|---|
| private final JDOMNavigator navigator The current context for XPath expression evaluation. The navigator is responsible for exposing JDOM content to Jaxen, including the wrapping of Namespace instances in NamespaceContainer Because of the need to wrap Namespace, we also need to unwrap namespace. Further, we can't re-use the details from one 'selectNodes' to another because the Document tree may have been modified between, and also, we do not want to be holding on to memory. Finally, we want to pre-load the NamespaceContext with the namespaces that are in scope for the contextNode being searched. So, we need to reset the Navigator before and after each use. try{} finally {} to the rescue. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Default mechanism. The serialization for this class is broken. It is only included here for compatibility with JDOM 1.x | |
| xPath | back to summary |
|---|---|
| private transient XPath xPath The compiled XPath object to select nodes. This attribute cannot be made final as it needs to be set upon object deserialization. | |
| JDOMXPath | back to summary |
|---|---|
| public JDOMXPath(String expr) throws JDOMException Creates a new XPath wrapper object, compiling the specified XPath expression.
| |
| addNamespace | back to summary |
|---|---|
| public void addNamespace(Namespace namespace) Implements abstract org. 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. | |
| getXPath | back to summary |
|---|---|
| public String getXPath() Implements abstract org. Returns the wrapped XPath expression as a string. | |
| numberValueOf | back to summary |
|---|---|
| public Number numberValueOf(Object context) throws JDOMException Implements abstract org. Returns the number value of the first item selected by applying the wrapped XPath expression to the given context.
| |
| selectNodes | back to summary |
|---|---|
| public List Implements abstract org. Evaluates the wrapped XPath expression and returns the list of selected items.
| |
| selectSingleNode | back to summary |
|---|---|
| public Object selectSingleNode(Object context) throws JDOMException Implements abstract org. Evaluates the wrapped XPath expression and returns the first entry in the list of selected nodes (or atomics).
| |
| setVariable | back to summary |
|---|---|
| public void setVariable(String name, Object value) throws IllegalArgumentException Implements abstract org. Defines an XPath variable and sets its value.
| |
| setXPath | back to summary |
|---|---|
| private void setXPath(String expr) throws JDOMException Compiles and sets the XPath expression wrapped by this object.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| unWrap | back to summary |
|---|---|
| private static final List Same story, need to be able to replace NamespaceContainer instances with Namespace content. | |
| unWrapNS | back to summary |
|---|---|
| private static final Object unWrapNS(Object o) Same story, need to be able to strip NamespaceContainer instances from Namespace content. | |
| valueOf | back to summary |
|---|---|
| public String valueOf(Object context) throws JDOMException Implements abstract org. Returns the string value of the first node selected by applying the wrapped XPath expression to the given context.
| |