org.jaxen.expr

Interface Step

public interface Step extends Predicated

Represents a location step in a LocationPath. The node-set selected by the location step is the node-set that results from generating an initial node-set from the axis and node-test, and then filtering that node-set by each of the predicates in turn.

The initial node-set consists of the nodes having the relationship to the context node specified by the axis, and having the node type and expanded-name specified by the node test.

Method Summary
IteratoraxisIterator(Object contextNode, ContextSupport support)
Get an Iterator for the current axis starting in the given contextNode.
Listevaluate(Context context)
For each node in the given context calls matches() for every node on the axis, then filters the result by each of the predicates.
intgetAxis()
Get an identifier for the current axis.
StringgetText()
Returns a String containing the XPath expression.
booleanmatches(Object node, ContextSupport contextSupport)
Performs the node-test part of evaluating the step for the given node (which must be on the axis).
voidsimplify()
Simplifies the XPath step.

Method Detail

axisIterator

public Iterator axisIterator(Object contextNode, ContextSupport support)
Get an Iterator for the current axis starting in the given contextNode.

Parameters: contextNode the node from which to follow this step support the remaining context for the traversal

Returns: an iterator over the nodes along the axis

Throws: UnsupportedAxisException if the navigator does not support this step's axis

evaluate

public List evaluate(Context context)
For each node in the given context calls matches() for every node on the axis, then filters the result by each of the predicates.

Returns: a list of matching nodes

getAxis

public int getAxis()
Get an identifier for the current axis.

Returns: the axis identifier

See Also: Axis

getText

public String getText()
Returns a String containing the XPath expression.

Returns: the text form of this step

matches

public boolean matches(Object node, ContextSupport contextSupport)
Performs the node-test part of evaluating the step for the given node (which must be on the axis).

Returns: true if the node matches this step; false if it doesn't

simplify

public void simplify()
Simplifies the XPath step. In practice, this is usually a noop. Jaxen does not currently perform any simplification.