Top Description Fields Constructors Methods
com.sun.org.apache.xpath.internal.axes

public Class WalkingIterator

extends LocPathIterator
implements ExpressionOwner
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xpath.internal.ExpressionOwner
Known Direct Subclasses
com.sun.org.apache.xpath.internal.axes.WalkingIteratorSorted
Imports
com.sun.org.apache.xml.internal.dtm.DTM, com.sun.org.apache.xml.internal.utils.PrefixResolver, .QName, com.sun.org.apache.xpath.internal.Expression, .ExpressionOwner, .VariableStack, .XPathVisitor, com.sun.org.apache.xpath.internal.compiler.Compiler, .OpMap, java.util.List

Location path iterator that uses Walkers.

Field Summary

Modifier and TypeField and Description
protected AxesWalker
m_firstWalker

The head of the step walker list.

protected AxesWalker
m_lastUsedWalker

The last used step walker in the walker list.

pack-priv static final long
Inherited from com.sun.org.apache.xpath.internal.axes.LocPathIterator:
m_allowDetachm_cdtmm_clonesm_contextm_currentContextNodem_execContextm_lastFetchedm_lengthm_posm_stackFrame

Constructor Summary

AccessConstructor and Description
pack-priv
WalkingIterator(Compiler
The Compiler which is creating this expression.
compiler
,
int
The position of this iterator in the opcode list from the compiler.
opPos
,
int analysis, boolean
True if walkers should be loaded, or false if this is a derived iterator and it doesn't wish to load child walkers.
shouldLoadWalkers
)

Create a WalkingIterator iterator, including creation of step walkers from the opcode list, and call back into the Compiler to create predicate expressions.

public
WalkingIterator(PrefixResolver
The namespace context for this iterator, should be OK if null.
nscontext
)

Create a WalkingIterator object.

Method Summary

Modifier and TypeMethod and Description
public void
callVisitors(ExpressionOwner
The owner of the visitor, where that path may be rewritten if needed.
owner
,
XPathVisitor
The visitor whose appropriate method will be called.
visitor
)

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.callVisitors.

Implements com.sun.org.apache.xpath.internal.XPathVisitable.callVisitors.

This will traverse the heararchy, calling the visitor for each member.

public Object

Returns:

A clone of this iterator that holds the same node position.
clone
()

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.clone.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.clone.

Get a cloned WalkingIterator that holds the same position as this iterator.

public boolean
deepEquals(Expression
Another expression object.
expr
)

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.deepEquals.

Compare this object with another object and see if they are equal, include the sub heararchy.

public void
detach()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.detach.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.detach.

Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.

public void
fixupVariables(List<QName>
List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).
vars
,
int globalsSize)

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.fixupVariables.

This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

public int

Returns:

One of WalkerFactory#BIT_DESCENDANT, etc.
getAnalysisBits
()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.getAnalysisBits.

Implements com.sun.org.apache.xpath.internal.axes.PathComponent.getAnalysisBits.

Get the analysis bits for this walker, as defined in the WalkerFactory.

public Expression
getExpression()

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.getExpression.

Get the raw Expression object that this class wraps.

public final AxesWalker

Returns:

The head of the walker list, or null if this iterator does not implement walkers.
getFirstWalker
()

Get the head of the walker list.

public final AxesWalker

Returns:

The last used walker, or null.
getLastUsedWalker
()

Get the last used walker.

public int

Returns:

The next Node in the set being iterated over, or null if there are no more members in that set.
nextNode
()

Implements abstract com.sun.org.apache.xpath.internal.axes.LocPathIterator.nextNode.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.nextNode.

Returns the next node in the set and advances the position of the iterator in the set.

public void
public void
setExpression(Expression
the raw Expression object, which should not normally be null.
exp
)

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.setExpression.

Set the raw expression object for this object.

public final void
setFirstWalker(AxesWalker
Should be a valid AxesWalker.
walker
)

Set the head of the walker list.

public final void
setLastUsedWalker(AxesWalker
The last used walker, or null.
walker
)

Set the last used walker.

public void
setRoot(int
The XPath runtime context for this transformation.
context
,
Object
The environment object. The environment in which this iterator operates, which should provide:
  • a node (the context node... same value as "root" defined below)
  • a pair of non-zero positive integers (the context position and the context size)
  • a set of variable bindings
  • a function library
  • the set of namespace declarations in scope for the expression.
    • At this time the exact implementation of this environment is application dependent. Probably a proper interface will be created fairly soon.

environment
)

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.setRoot.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.setRoot.

Initialize the context values for this expression after it is cloned.

Inherited from com.sun.org.apache.xpath.internal.axes.LocPathIterator:
allowDetachToReleaseasIteratorasNodeboolcloneWithResetexecuteexecuteCharsToContentHandlergetAxisgetContextgetCurrentContextNodegetCurrentNodegetCurrentPosgetDTMgetDTMManagergetExpandEntityReferencesgetFiltergetFoundLastgetIsTopLevelgetLastPosgetLengthgetPrefixResolvergetRootgetWhatToShowgetXPathContextincrementCurrentPosisDocOrderedisFreshisMutableisNodesetExpritempreviousNodereturnNextNoderunTosetCurrentContextNodesetCurrentPossetEnvironmentsetIsTopLevelsetItemsetNextPositionsetShouldCacheNodessize

Field Detail

m_firstWalkerback to summary
protected AxesWalker m_firstWalker

The head of the step walker list.

m_lastUsedWalkerback to summary
protected AxesWalker m_lastUsedWalker

The last used step walker in the walker list.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.sun.org.apache.xpath.internal.axes.LocPathIterator.serialVersionUID.

Constructor Detail

WalkingIteratorback to summary
pack-priv WalkingIterator(Compiler compiler, int opPos, int analysis, boolean shouldLoadWalkers) throws TransformerException

Create a WalkingIterator iterator, including creation of step walkers from the opcode list, and call back into the Compiler to create predicate expressions.

Parameters
compiler:Compiler

The Compiler which is creating this expression.

opPos:int

The position of this iterator in the opcode list from the compiler.

shouldLoadWalkers:boolean

True if walkers should be loaded, or false if this is a derived iterator and it doesn't wish to load child walkers.

WalkingIteratorback to summary
public WalkingIterator(PrefixResolver nscontext)

Create a WalkingIterator object.

Parameters
nscontext:PrefixResolver

The namespace context for this iterator, should be OK if null.

Method Detail

callVisitorsback to summary
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.callVisitors.

Implements com.sun.org.apache.xpath.internal.XPathVisitable.callVisitors.

Doc from com.sun.org.apache.xpath.internal.XPathVisitable.callVisitors.

This will traverse the heararchy, calling the visitor for each member. If the called visitor method returns false, the subtree should not be called.

Parameters
owner:ExpressionOwner

The owner of the visitor, where that path may be rewritten if needed.

visitor:XPathVisitor

The visitor whose appropriate method will be called.

See Also
com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.clone.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.clone.

Get a cloned WalkingIterator that holds the same position as this iterator.

Returns:Object

A clone of this iterator that holds the same node position.

Exceptions
CloneNotSupportedException:

Doc from java.lang.Object.clone.

if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

deepEqualsback to summary
public boolean deepEquals(Expression expr)

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.deepEquals.

Doc from com.sun.org.apache.xpath.internal.Expression.deepEquals.

Compare this object with another object and see if they are equal, include the sub heararchy.

Parameters
expr:Expression

Another expression object.

Returns:boolean

true if this objects class and the expr object's class are the same, and the data contained within both objects are considered equal.

See Also
Expression#deepEquals(Expression)
detachback to summary
public void detach()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.detach.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.detach.

Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. Afterdetach has been invoked, calls to nextNode orpreviousNode will raise the exception INVALID_STATE_ERR.

fixupVariablesback to summary
public void fixupVariables(List<QName> vars, int globalsSize)

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.fixupVariables.

This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

Parameters
vars:List<QName>

List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).

getAnalysisBitsback to summary
public int getAnalysisBits()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.getAnalysisBits.

Implements com.sun.org.apache.xpath.internal.axes.PathComponent.getAnalysisBits.

Get the analysis bits for this walker, as defined in the WalkerFactory.

Returns:int

One of WalkerFactory#BIT_DESCENDANT, etc.

getExpressionback to summary
public Expression getExpression()

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.getExpression.

Doc from com.sun.org.apache.xpath.internal.ExpressionOwner.getExpression.

Get the raw Expression object that this class wraps.

Returns:Expression

the raw Expression object, which should not normally be null.

See Also
ExpressionOwner#getExpression()
getFirstWalkerback to summary
public final AxesWalker getFirstWalker()

Get the head of the walker list.

Returns:AxesWalker

The head of the walker list, or null if this iterator does not implement walkers.

getLastUsedWalkerback to summary
public final AxesWalker getLastUsedWalker()

Get the last used walker.

Returns:AxesWalker

The last used walker, or null.

nextNodeback to summary
public int nextNode()

Implements abstract com.sun.org.apache.xpath.internal.axes.LocPathIterator.nextNode.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.nextNode.

Returns the next node in the set and advances the position of the iterator in the set. After a NodeIterator is created, the first call to nextNode() returns the first node in the set.

Returns:int

The next Node in the set being iterated over, or null if there are no more members in that set.

resetback to summary
public void reset()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.reset.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.reset.

Reset the iterator.

setExpressionback to summary
public void setExpression(Expression exp)

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.setExpression.

Doc from com.sun.org.apache.xpath.internal.ExpressionOwner.setExpression.

Set the raw expression object for this object.

Parameters
exp:Expression

the raw Expression object, which should not normally be null.

See Also
ExpressionOwner#setExpression(Expression)
setFirstWalkerback to summary
public final void setFirstWalker(AxesWalker walker)

Set the head of the walker list.

Parameters
walker:AxesWalker

Should be a valid AxesWalker.

setLastUsedWalkerback to summary
public final void setLastUsedWalker(AxesWalker walker)

Set the last used walker.

Parameters
walker:AxesWalker

The last used walker, or null.

setRootback to summary
public void setRoot(int context, Object environment)

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.setRoot.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.setRoot.

Initialize the context values for this expression after it is cloned.

Parameters
context:int

The XPath runtime context for this transformation.

environment:Object

Doc from com.sun.org.apache.xml.internal.dtm.DTMIterator.setRoot.

The environment object. The environment in which this iterator operates, which should provide:

  • a node (the context node... same value as "root" defined below)
  • a pair of non-zero positive integers (the context position and the context size)
  • a set of variable bindings
  • a function library
  • the set of namespace declarations in scope for the expression.
    • At this time the exact implementation of this environment is application dependent. Probably a proper interface will be created fairly soon.