Class: com.sun.org.apache.xpath.internal.axes.AxesWalker
- public class AxesWalker
- extends PredicatedNodeTest
- implements Cloneable, PathComponent, ExpressionOwner
Serves as common interface for axes Walkers, and stores common
state variables.
Inheritance
Superclass tree:- java.lang.Object
- com.sun.org.apache.xpath.internal.Expression
- com.sun.org.apache.xpath.internal.patterns.NodeTest
- com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest
- com.sun.org.apache.xpath.internal.axes.AxesWalker
Methods
-
AxesWalkertop
public AxesWalker(LocPathIterator locPathIterator, int axis)Construct an AxesWalker using a LocPathIterator. -
callVisitorstop
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)This will traverse the heararchy, calling the visitor for each member. If the called visitor method returns false, the subtree should not be called.- Specified by:
- callVisitors from XPathVisitable
- Override hierarchy:
- callVisitors from NodeTest
-
clonetop
public Object clone() throws CloneNotSupportedExceptionGet a cloned AxesWalker.- Override hierarchy:
- clone from PredicatedNodeTest
- clone from Object
-
cloneDeeptop
AxesWalker cloneDeep(WalkingIterator cloneOwner, Vector cloneList) throws CloneNotSupportedExceptionDo a deep clone of this walker, including next and previous walkers. If the this AxesWalker is on the clone list, don't clone but return the already cloned version. -
deepEqualstop
public boolean deepEquals(Expression expr)Compare this object with another object and see if they are equal, include the sub heararchy.- Override hierarchy:
- deepEquals from PredicatedNodeTest
- deepEquals from NodeTest
- deepEquals from Expression
-
detachtop
public void detach()Detaches the walker from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. -
findClonetop
Find a clone that corresponds to the key argument. -
getAnalysisBitstop
public int getAnalysisBits()Get the analysis bits for this walker, as defined in the WalkerFactory.- Specified by:
- getAnalysisBits from PathComponent
-
getAxistop
public int getAxis()Returns the axis being iterated, if it is known. -
getCurrentNodetop
public final int getCurrentNode()The node at which the TreeWalker is currently positioned.
The value must not be null. Alterations to the DOM tree may cause the current node to no longer be accepted by the TreeWalker's associated filter. currentNode may also be explicitly set to any node, whether or not it is within the subtree specified by the root node or would be accepted by the filter and whatToShow flags. Further traversal occurs relative to currentNode even if it is not part of the current view by applying the filters in the requested direction (not changing currentNode where no traversal is possible). -
getDTMtop
public DTM getDTM(int node)Get the DTM for this walker. -
getExpressiontop
public Expression getExpression()Get the raw Expression object that this class wraps.- Specified by:
- getExpression from ExpressionOwner
-
getLastPostop
public int getLastPos(XPathContext xctxt)Get the index of the last node that can be itterated to.- Specified by:
- getLastPos from SubContextList
- Override hierarchy:
- getLastPos from PredicatedNodeTest
-
getNextNodetop
protected int getNextNode()Get the next node in document order on the axes. -
getNextWalkertop
public AxesWalker getNextWalker()Get the next walker in the location step chain. -
getPrevWalkertop
public AxesWalker getPrevWalker()Get the previous walker reference in the location step chain. -
getRoottop
public int getRoot()The root node of the TreeWalker, as specified in setRoot(int root). Note that this may actually be below the current node. -
inittop
public void init(Compiler compiler, int opPos, int stepType) throws TransformerExceptionInitialize an AxesWalker during the parse of the XPath expression. -
isDocOrderedtop
public boolean isDocOrdered()Returns true if all the nodes in the iteration well be returned in document order. Warning: This can only be called after setRoot has been called! -
nextNodetop
public int nextNode()Moves theTreeWalkerto the next visible node in document order relative to the current node, and returns the new node. If the current node has no next node, or if the search for nextNode attempts to step upward from the TreeWalker's root node, returnsnull, and retains the current node. -
returnNextNodetop
private int returnNextNode(int n)This is simply a way to bottle-neck the return of the next node, for diagnostic purposes. -
setDefaultDTMtop
public void setDefaultDTM(DTM dtm)Set the DTM for this walker. -
setExpressiontop
public void setExpression(Expression exp)Set the raw expression object for this object.- Specified by:
- setExpression from ExpressionOwner
-
setNextWalkertop
public void setNextWalker(AxesWalker walker)Set the next walker in the location step chain. -
setPrevWalkertop
public void setPrevWalker(AxesWalker walker)Set or clear the previous walker reference in the location step chain. -
setRoottop
public void setRoot(int root)Set the root node of the TreeWalker. (Not part of the DOM2 TreeWalker interface). -
witop
public final WalkingIterator wi()
Fields
-
m_axis
protected int m_axisThe traversal axis from where the nodes will be filtered. -
m_currentNode
transient private int m_currentNodeThe node at which the TreeWalker is currently positioned. -
m_dtm
private DTM m_dtmThe DTM for the root. This can not be used, or must be changed, for the filter walker, or any walker that can have nodes from multiple documents. Never, ever, access this value without going through getDTM(int node). -
m_isFresh
transient boolean m_isFreshTrue if an itteration has not begun. -
m_nextWalker
protected AxesWalker m_nextWalkerThe next walker in the location step chain. -
m_prevWalker
AxesWalker m_prevWalkerThe previous walker in the location step chain, or null. -
m_root
transient int m_rootThe root node of the TreeWalker, as specified when it was created. -
m_traverser
protected DTMAxisTraverser m_traverserThe DTM inner traversal class, that corresponds to the super axis. -
serialVersionUID
static final long serialVersionUID = -2966031951306601247
