org.jaxen.javabean

Class JavaBeanXPath

public class JavaBeanXPath extends BaseXPath

An XPath implementation for JavaBeans.

This is the main entry point for matching an XPath against a JavaBean tree. You create a compiled XPath object, then match it against one or more context nodes using the {@link #selectNodes(Object)} method, as in the following example:

 Node node = ...;
 XPath path = new JavaBeanXPath("a/b/c");
 List results = path.selectNodes(node);
 

Version: $Revision: 1.6 $

Author: bob mcwhirter

See Also:

Field Summary
static longserialVersionUID
Constructor Summary
JavaBeanXPath(String xpathExpr)
Construct given an XPath expression string.
Method Summary
Objectevaluate(Object node)
protected ContextgetContext(Object node)

Field Detail

serialVersionUID

private static final long serialVersionUID

Constructor Detail

JavaBeanXPath

public JavaBeanXPath(String xpathExpr)
Construct given an XPath expression string.

Parameters: xpathExpr The XPath expression.

Throws: JaxenException if there is a syntax error while parsing the expression

Method Detail

evaluate

public Object evaluate(Object node)

getContext

protected Context getContext(Object node)