Home » commons-jxpath-1.3-src » org.apache.commons.jxpath.ri » [javadoc | source]
org.apache.commons.jxpath.ri
abstract public class: EvalContext [javadoc | source]
java.lang.Object
   org.apache.commons.jxpath.ri.EvalContext

All Implemented Interfaces:
    Iterator, ExpressionContext

Direct Known Subclasses:
    ParentContext, UnionContext, AncestorContext, PrecedingOrFollowingContext, NodeSetContext, SelfContext, RootContext, NamespaceContext, InitialContext, ChildContext, DescendantContext, AttributeContext, PredicateContext

An XPath evaluation context. When evaluating a path, a chain of EvalContexts is created, each context in the chain representing a step of the path. Subclasses of EvalContext implement behavior of various XPath axes: "child::", "parent::" etc.
Field Summary
protected  EvalContext parentContext     
protected  RootContext rootContext     
protected  int position     
Constructor:
 public EvalContext(EvalContext parentContext) 
Method from org.apache.commons.jxpath.ri.EvalContext Summary:
getContextNodeList,   getContextNodePointer,   getCurrentNodePointer,   getCurrentPosition,   getDocumentOrder,   getJXPathContext,   getNodeSet,   getPosition,   getRootContext,   getSingleNodePointer,   getValue,   hasNext,   isChildOrderingRequired,   next,   nextNode,   nextSet,   remove,   reset,   setPosition,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.jxpath.ri.EvalContext Detail:
 public List getContextNodeList() 
    Returns the list of all Pointers in this context for the current position of the parent context.
 public Pointer getContextNodePointer() 
 abstract public NodePointer getCurrentNodePointer()
    Returns the current context node. Undefined before the beginning of the iteration.
 public int getCurrentPosition() 
 public int getDocumentOrder() 
    Determines the document order for this context.
 public JXPathContext getJXPathContext() 
 public NodeSet getNodeSet() 
    Returns the list of all Pointers in this context for all positions of the parent contexts. If there was an ongoing iteration over this context, the method should not be called.
 public int getPosition() 
 public RootContext getRootContext() 
    Returns the root context of the path, which provides easy access to variables and functions.
 public Pointer getSingleNodePointer() 
    Returns the first encountered Pointer that matches the current context's criteria.
 public Object getValue() 
    Typically returns the NodeSet by calling getNodeSet(), but will be overridden for contexts that more naturally produce individual values, e.g. VariableContext
 public boolean hasNext() 
    Returns true if there are mode nodes matching the context's constraints.
 public boolean isChildOrderingRequired() 
    Even if this context has the natural ordering and therefore does not require collecting and sorting all nodes prior to returning them, such operation may be required for any child context.
 public Object next() 
    Returns the next node pointer in the context
 abstract public boolean nextNode()
    Returns true if there is another object in the current set. Switches the current position and node to the next object.
 public boolean nextSet() 
    Returns true if there is another sets of objects to interate over. Resets the current position and node.
 public  void remove() 
    Operation is not supported
 public  void reset() 
    Sets current position = 0, which is the pre-iteration state.
 public boolean setPosition(int position) 
    Moves the current position to the specified index. Used with integer predicates to quickly get to the n'th element of the node set. Returns false if the position is out of the node set range. You can call it with 0 as the position argument to restart the iteration.
 public String toString()