org.jaxen.expr

Class DefaultXPathExpr

Implemented Interfaces:
Serializable, XPathExpr

public class DefaultXPathExpr
extends java.lang.Object
implements XPathExpr

Field Summary

private Expr
rootExpr
private static long
serialVersionUID

Constructor Summary

DefaultXPathExpr(Expr rootExpr)

Method Summary

List
asList(Context context)
Evaluates the expression and returns a list cintaing the resulting nodes, or a singleton list containing a Double, String, or Boolean.
Expr
getRootExpr()
Returns the wrapped expression object.
String
getText()
Returns a String containing the XPath expression.
void
setRootExpr(Expr rootExpr)
Changes the wrapped expression object.
void
simplify()
Simplifies the XPath expression.
String
toString()

Field Details

rootExpr

private Expr rootExpr

serialVersionUID

private static final long serialVersionUID
Field Value:
3007613096320896040L

Constructor Details

DefaultXPathExpr

public DefaultXPathExpr(Expr rootExpr)

Method Details

asList

public List asList(Context context)
            throws JaxenException
Evaluates the expression and returns a list cintaing the resulting nodes, or a singleton list containing a Double, String, or Boolean.
Specified by:
asList in interface XPathExpr
Parameters:
context - the context in which to evaluate this expression
Returns:
a list
Throws:
JaxenException -

getRootExpr

public Expr getRootExpr()
Returns the wrapped expression object.
Specified by:
getRootExpr in interface XPathExpr
Returns:
the wrapped Expr object

getText

public String getText()
Returns a String containing the XPath expression.
Specified by:
getText in interface XPathExpr
Returns:
the text form of this XPath expression

setRootExpr

public void setRootExpr(Expr rootExpr)
Changes the wrapped expression object.
Specified by:
setRootExpr in interface XPathExpr
Parameters:
rootExpr - the new expression object to wrap

simplify

public void simplify()
Simplifies the XPath expression. For example, the expression //para[1 = 1] could be simplified to //para. In practice, this is usually a noop. Jaxen does not currently perform any simplification.
Specified by:
simplify in interface XPathExpr

toString

public String toString()