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

public Class FilterExprWalker

extends AxesWalker
Class Inheritance
Imports
com.sun.org.apache.xml.internal.dtm.Axis, .DTM, .DTMIterator, com.sun.org.apache.xml.internal.utils.QName, com.sun.org.apache.xpath.internal.Expression, .ExpressionOwner, .XPathContext, .XPathVisitor, com.sun.org.apache.xpath.internal.compiler.Compiler, .OpCodes, com.sun.org.apache.xpath.internal.objects.XNodeSet, java.util.List

Walker for the OP_VARIABLE, or OP_EXTFUNCTION, or OP_FUNCTION, or OP_GROUP, op codes.
See Also
XPath FilterExpr descriptions

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private boolean
private Expression
m_expr

The contained expression.

private transient XNodeSet
m_exprObj

The result of executing m_expr.

private boolean
pack-priv static final long
Inherited from com.sun.org.apache.xpath.internal.axes.AxesWalker:
m_axism_isFreshm_nextWalkerm_prevWalkerm_rootm_traverser

Constructor Summary

AccessConstructor and Description
public
FilterExprWalker(WalkingIterator
non-null reference to the parent iterator.
locPathIterator
)

Construct a FilterExprWalker using a LocPathIterator.

Method Summary

Modifier and TypeMethod and Description
public short

Returns:

a constant to determine whether the node is accepted, rejected, or skipped, as defined above .
acceptNode
(int
The node to check to see if it passes the filter or not.
n
)

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

This method needs to override AxesWalker.acceptNode because FilterExprWalkers don't need to, and shouldn't, do a node test.

public void
callPredicateVisitors(XPathVisitor
The visitor whose appropriate method will be called.
visitor
)

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

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

public Object

Returns:

A new FilterExprWalker that can be used without mutating this one.
clone
()

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

Get a cloned FilterExprWalker.

public boolean
deepEquals(Expression
Another expression object.
expr
)

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.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.AxesWalker.detach.

Detaches the walker 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.AxesWalker.getAnalysisBits.

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

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

public int

Returns:

Axis.CHILD, etc., or -1 if the axis is not known or is of multiple types.
getAxis
()

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.getAxis.

Returns the axis being iterated, if it is known.

public Expression
getInnerExpression()

Get the inner contained expression of this filter.

public int

Returns:

the index of the last node that can be itterated to.
getLastPos
(XPathContext
XPath runtime context.
xctxt
)

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.getLastPos.

Implements com.sun.org.apache.xpath.internal.axes.SubContextList.getLastPos.

Get the index of the last node that can be itterated to.

public int

Returns:

The new node, or null if the current node has no next node in the TreeWalker's logical view.
getNextNode
()

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.getNextNode.

Moves the TreeWalker to the next visible node in document order relative to the current node, and returns the new node.

public void
init(Compiler
non-null reference to the Compiler that is constructing.
compiler
,
int
positive opcode position for this step.
opPos
,
int
The type of step.
stepType
)

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.init.

Init a FilterExprWalker.

public boolean

Returns:

true as a default.
isDocOrdered
()

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.isDocOrdered.

Returns true if all the nodes in the iteration well be returned in document order.

public void
setInnerExpression(Expression expr)

Set the inner contained expression of this filter.

public void
setRoot(int
non-null reference to the root, or starting point of the query.
root
)

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

Set the root node of the TreeWalker.

Inherited from com.sun.org.apache.xpath.internal.axes.AxesWalker:
callVisitorscloneDeepfindClonegetCurrentNodegetDTMgetExpressiongetNextWalkergetPrevWalkergetRootnextNodesetDefaultDTMsetExpressionsetNextWalkersetPrevWalkerwi

Field Detail

m_canDetachNodesetback to summary
private boolean m_canDetachNodeset
m_exprback to summary
private Expression m_expr

The contained expression. Should be non-null.

m_exprObjback to summary
private transient XNodeSet m_exprObj

The result of executing m_expr. Needs to be deep cloned on clone op.

m_mustHardResetback to summary
private boolean m_mustHardReset
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

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

Constructor Detail

FilterExprWalkerback to summary
public FilterExprWalker(WalkingIterator locPathIterator)

Construct a FilterExprWalker using a LocPathIterator.

Parameters
locPathIterator:WalkingIterator

non-null reference to the parent iterator.

Method Detail

acceptNodeback to summary
public short acceptNode(int n)

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

This method needs to override AxesWalker.acceptNode because FilterExprWalkers don't need to, and shouldn't, do a node test.

Parameters
n:int

The node to check to see if it passes the filter or not.

Returns:short

a constant to determine whether the node is accepted, rejected, or skipped, as defined above .

callPredicateVisitorsback to summary
public void callPredicateVisitors(XPathVisitor visitor)

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

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
visitor:XPathVisitor

The visitor whose appropriate method will be called.

cloneback to summary
public Object clone() throws CloneNotSupportedException

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

Get a cloned FilterExprWalker.

Returns:Object

A new FilterExprWalker that can be used without mutating this one.

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.AxesWalker.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.AxesWalker.detach.

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

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.AxesWalker.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.

getAxisback to summary
public int getAxis()

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.getAxis.

Returns the axis being iterated, if it is known.

Returns:int

Axis.CHILD, etc., or -1 if the axis is not known or is of multiple types.

getInnerExpressionback to summary
public Expression getInnerExpression()

Get the inner contained expression of this filter.

getLastPosback to summary
public int getLastPos(XPathContext xctxt)

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.getLastPos.

Implements com.sun.org.apache.xpath.internal.axes.SubContextList.getLastPos.

Get the index of the last node that can be itterated to.

Parameters
xctxt:XPathContext

XPath runtime context.

Returns:int

the index of the last node that can be itterated to.

getNextNodeback to summary
public int getNextNode()

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.getNextNode.

Moves the TreeWalker to 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, returns null , and retains the current node.

Returns:int

The new node, or null if the current node has no next node in the TreeWalker's logical view.

initback to summary
public void init(Compiler compiler, int opPos, int stepType) throws TransformerException

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.init.

Init a FilterExprWalker.

Parameters
compiler:Compiler

non-null reference to the Compiler that is constructing.

opPos:int

positive opcode position for this step.

stepType:int

The type of step.

Annotations
@SuppressWarnings:fallthrough
isDocOrderedback to summary
public boolean isDocOrdered()

Overrides com.sun.org.apache.xpath.internal.axes.AxesWalker.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!

Returns:boolean

true as a default.

setInnerExpressionback to summary
public void setInnerExpression(Expression expr)

Set the inner contained expression of this filter.

setRootback to summary
public void setRoot(int root)

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

Set the root node of the TreeWalker.

Parameters
root:int

non-null reference to the root, or starting point of the query.

com.sun.org.apache.xpath.internal.axes back to summary

pack-priv Class FilterExprWalker.filterExprOwner

extends Object
implements ExpressionOwner
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xpath.internal.axes.FilterExprWalker.filterExprOwner
All Implemented Interfaces
com.sun.org.apache.xpath.internal.ExpressionOwner

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Expression
getExpression()

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

Get the raw Expression object that this class wraps.

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

filterExprOwnerback to summary
pack-priv filterExprOwner()

Method Detail

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()
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)