org.apache.wvcm.util
Class XPathWrapper

java.lang.Object
  extended by org.apache.wvcm.util.XPathWrapper

public class XPathWrapper
extends java.lang.Object


Constructor Summary
XPathWrapper(java.lang.String expression, org.jdom.Namespace nsp)
          Constructor
 
Method Summary
 java.util.List selectNodes(java.lang.Object context)
          Evaluates the wrapped XPath expression and returns the list of selected nodes.
 java.lang.Object selectSingleNode(java.lang.Object context)
          Evaluates the wrapped XPath expression and returns the first entry in the list of selected nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathWrapper

public XPathWrapper(java.lang.String expression,
                    org.jdom.Namespace nsp)
             throws WvcmException
Constructor

Parameters:
expression - a String
Throws:
WvcmException
Method Detail

selectNodes

public java.util.List selectNodes(java.lang.Object context)
                           throws WvcmException
Evaluates the wrapped XPath expression and returns the list of selected nodes.

Parameters:
context - the node to use as context for evaluating the XPath expression.
Returns:
the list of selected nodes, which can be instances of the following JDOM classes: Element, Attribute, Text, CDATA, Comment or ProcessingInstruction.
Throws:
WvcmException

selectSingleNode

public java.lang.Object selectSingleNode(java.lang.Object context)
                                  throws WvcmException
Evaluates the wrapped XPath expression and returns the first entry in the list of selected nodes.

Parameters:
context - the node to use as context for evaluating the XPath expression.
Returns:
the first selected nodes, which is an instance of one of the following JDOM classes: Element, Attribute, Text, CDATA, Comment or ProcessingInstruction or null if no node was selected.
Throws:
WvcmException


Copyright (c) 2003 - Apache Software Foundation