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

public abstract Class PredicatedNodeTest

extends NodeTest
implements SubContextList
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xpath.internal.axes.SubContextList
Known Direct Subclasses
com.sun.org.apache.xpath.internal.axes.AxesWalker, com.sun.org.apache.xpath.internal.axes.LocPathIterator
Imports
com.sun.org.apache.xml.internal.dtm.DTM, .DTMIterator, com.sun.org.apache.xml.internal.utils.PrefixResolver, .QName, .WrappedRuntimeException, com.sun.org.apache.xpath.internal.Expression, .ExpressionOwner, .XPathContext, .XPathVisitor, com.sun.org.apache.xpath.internal.compiler.Compiler, com.sun.org.apache.xpath.internal.objects.XObject, com.sun.org.apache.xpath.internal.patterns.NodeTest, java.util.List

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
pack-priv static final boolean
DEBUG_PREDICATECOUNTING

If true, diagnostic messages about predicate execution will be posted.

protected transient boolean
m_foundLast

This is true if nextNode returns null.

protected LocPathIterator
m_lpi

The owning location path iterator.

protected int
pack-priv transient int
m_predicateIndex

Which predicate we are executing.

private Expression[]
m_predicates

The list of predicate expressions.

protected transient int[]
m_proximityPositions

An array of counts that correspond to the number of predicates the step contains.

pack-priv static final long
Inherited from com.sun.org.apache.xpath.internal.patterns.NodeTest:
m_namem_whatToShowSCORE_NODETESTSCORE_NONESCORE_NSWILDSCORE_OTHERSCORE_QNAMESHOW_BYFUNCTIONSUPPORTS_PRE_STRIPPINGWILD

Constructor Summary

AccessConstructor and Description
pack-priv
PredicatedNodeTest(LocPathIterator
non-null reference to the parent iterator.
locPathIterator
)

Construct an AxesWalker using a LocPathIterator.

pack-priv
PredicatedNodeTest()

Construct an AxesWalker.

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
)

Test whether a specified node is visible in the logical view of a TreeWalker or NodeIterator.

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

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

public boolean

Returns:

true if traversal outside the context node's subtree can occur.
canTraverseOutsideSubtree
()

Overrides com.sun.org.apache.xpath.internal.Expression.canTraverseOutsideSubtree.

Tell if this expression or it's subexpressions can traverse outside the current subtree.

public Object

Returns:

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

Overrides java.lang.Object.clone.

Get a cloned PrdicatedNodeTest.

protected void
countProximityPosition(int
The index into the m_proximityPositions array, where the increment will occur.
i
)

Count forward one proximity position.

public boolean
deepEquals(Expression
Another expression object.
expr
)

Overrides com.sun.org.apache.xpath.internal.patterns.NodeTest.deepEquals.

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

pack-priv boolean

Returns:

the result of executing the predicate expressions.
executePredicates
(int
The current context node.
context
,
XPathContext
The XPath runtime context.
xctxt
)

Process the predicates.

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.patterns.NodeTest.fixupVariables.

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

public abstract int

Returns:

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

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

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

public LocPathIterator

Returns:

the owning location path iterator, which should not be null.
getLocPathIterator
()

Get the owning location path iterator.

public Expression

Returns:

A predicate expression.
getPredicate
(int
Index of the predicate.
index
)

Get a predicate expression at the given index.

public int

Returns:

the number of predicates that this walker has.
getPredicateCount
()

Get the number of predicates that this walker has.

public int

Returns:

The current predicate index, or -1 if no predicate is executing.
getPredicateIndex
()

Get which predicate is executing.

public int

Returns:

The node position of this walker in the sub-context node list.
getProximityPosition
()

Get the current sub-context position.

public int

Returns:

The node position of this walker in the sub-context node list.
getProximityPosition
(XPathContext
The XPath runtime context.
xctxt
)

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

Get the current sub-context position.

protected int

Returns:

The node position of this walker in the sub-context node list.
getProximityPosition
(int
The index of the predicate where the proximity should be taken from.
predicateIndex
)

Get the current sub-context position.

protected void
initPredicateInfo(Compiler
The Compiler object that has information about this walker in the op map.
compiler
,
int
The op code position of this location step.
opPos
)

Init predicate info.

public void
initProximityPosition(int
The index into the m_proximityPositions array.
i
)

Init the proximity position to zero for a forward axes.

public boolean

Returns:

false, unless a derived class overrides.
isReverseAxes
()

Tells if this is a reverse axes.

protected String

Returns:

Informative string about the argument.
nodeToString
(int
Node to give diagnostic information about, or null.
n
)

Diagnostics.

private void
readObject(ObjectInputStream
Input stream to read from
stream
)

Read the object from a serialization stream.

public void
resetProximityPositions()

Reset the proximity positions counts.

public void
setLocPathIterator(LocPathIterator
non-null reference to the owning location path iterator.
li
)

Set the location path iterator owner for this walker.

public void
setPredicateCount(int
The number of predicates, which must be equal or less than the existing count.
count
)

Set the number of predicates that this walker has.

Inherited from com.sun.org.apache.xpath.internal.patterns.NodeTest:
calcScorecallVisitorsdebugWhatToShowexecuteexecuteexecutegetDefaultScoregetLocalNamegetNamespacegetNodeTypeTestgetStaticScoregetWhatToShowinitNodeTestinitNodeTestsetLocalNamesetNamespacesetStaticScoresetWhatToShow

Field Detail

DEBUG_PREDICATECOUNTINGback to summary
pack-priv static final boolean DEBUG_PREDICATECOUNTING

If true, diagnostic messages about predicate execution will be posted.

m_foundLastback to summary
protected transient boolean m_foundLast

This is true if nextNode returns null.

m_lpiback to summary
protected LocPathIterator m_lpi

The owning location path iterator.

m_predCountback to summary
protected int m_predCount
m_predicateIndexback to summary
pack-priv transient int m_predicateIndex

Which predicate we are executing.

m_predicatesback to summary
private Expression[] m_predicates

The list of predicate expressions. Is static and does not need to be deep cloned.

m_proximityPositionsback to summary
protected transient int[] m_proximityPositions

An array of counts that correspond to the number of predicates the step contains.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.sun.org.apache.xpath.internal.patterns.NodeTest.serialVersionUID.

Constructor Detail

PredicatedNodeTestback to summary
pack-priv PredicatedNodeTest(LocPathIterator locPathIterator)

Construct an AxesWalker using a LocPathIterator.

Parameters
locPathIterator:LocPathIterator

non-null reference to the parent iterator.

PredicatedNodeTestback to summary
pack-priv PredicatedNodeTest()

Construct an AxesWalker. The location path iterator will have to be set before use.

Method Detail

acceptNodeback to summary
public short acceptNode(int n)

Test whether a specified node is visible in the logical view of a TreeWalker or NodeIterator. This function will be called by the implementation of TreeWalker and NodeIterator; it is not intended to be called directly from user code.

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)

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.

canTraverseOutsideSubtreeback to summary
public boolean canTraverseOutsideSubtree()

Overrides com.sun.org.apache.xpath.internal.Expression.canTraverseOutsideSubtree.

Tell if this expression or it's subexpressions can traverse outside the current subtree.

Returns:boolean

true if traversal outside the context node's subtree can occur.

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Get a cloned PrdicatedNodeTest.

Returns:Object

A new PredicatedNodeTest 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.

countProximityPositionback to summary
protected void countProximityPosition(int i)

Count forward one proximity position.

Parameters
i:int

The index into the m_proximityPositions array, where the increment will occur.

deepEqualsback to summary
public boolean deepEquals(Expression expr)

Overrides com.sun.org.apache.xpath.internal.patterns.NodeTest.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)
executePredicatesback to summary
pack-priv boolean executePredicates(int context, XPathContext xctxt) throws TransformerException

Process the predicates.

Parameters
context:int

The current context node.

xctxt:XPathContext

The XPath runtime context.

Returns:boolean

the result of executing the predicate expressions.

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

Overrides com.sun.org.apache.xpath.internal.patterns.NodeTest.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).

getLastPosback to summary
public abstract int getLastPos(XPathContext xctxt)

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

getLocPathIteratorback to summary
public LocPathIterator getLocPathIterator()

Get the owning location path iterator.

Returns:LocPathIterator

the owning location path iterator, which should not be null.

getPredicateback to summary
public Expression getPredicate(int index)

Get a predicate expression at the given index.

Parameters
index:int

Index of the predicate.

Returns:Expression

A predicate expression.

getPredicateCountback to summary
public int getPredicateCount()

Get the number of predicates that this walker has.

Returns:int

the number of predicates that this walker has.

getPredicateIndexback to summary
public int getPredicateIndex()

Get which predicate is executing.

Returns:int

The current predicate index, or -1 if no predicate is executing.

getProximityPositionback to summary
public int getProximityPosition()

Get the current sub-context position.

Returns:int

The node position of this walker in the sub-context node list.

getProximityPositionback to summary
public int getProximityPosition(XPathContext xctxt)

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

Get the current sub-context position.

Parameters
xctxt:XPathContext

The XPath runtime context.

Returns:int

The node position of this walker in the sub-context node list.

getProximityPositionback to summary
protected int getProximityPosition(int predicateIndex)

Get the current sub-context position.

Parameters
predicateIndex:int

The index of the predicate where the proximity should be taken from.

Returns:int

The node position of this walker in the sub-context node list.

initPredicateInfoback to summary
protected void initPredicateInfo(Compiler compiler, int opPos) throws TransformerException

Init predicate info.

Parameters
compiler:Compiler

The Compiler object that has information about this walker in the op map.

opPos:int

The op code position of this location step.

initProximityPositionback to summary
public void initProximityPosition(int i) throws TransformerException

Init the proximity position to zero for a forward axes.

Parameters
i:int

The index into the m_proximityPositions array.

isReverseAxesback to summary
public boolean isReverseAxes()

Tells if this is a reverse axes.

Returns:boolean

false, unless a derived class overrides.

nodeToStringback to summary
protected String nodeToString(int n)

Diagnostics.

Parameters
n:int

Node to give diagnostic information about, or null.

Returns:String

Informative string about the argument.

readObjectback to summary
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException

Read the object from a serialization stream.

Parameters
stream:ObjectInputStream

Input stream to read from

Exceptions
IOException:
in case of any IO related exceptions
ClassNotFoundException:
if Class of the serialized object cannot be found
resetProximityPositionsback to summary
public void resetProximityPositions()

Reset the proximity positions counts.

setLocPathIteratorback to summary
public void setLocPathIterator(LocPathIterator li)

Set the location path iterator owner for this walker. Besides initialization, this function is called during cloning operations.

Parameters
li:LocPathIterator

non-null reference to the owning location path iterator.

setPredicateCountback to summary
public void setPredicateCount(int count)

Set the number of predicates that this walker has. This does more that one would think, as it creates a new predicate array of the size of the count argument, and copies count predicates into the new one from the old, and then reassigns the predicates value. All this to keep from having to have a predicate count value.

Parameters
count:int

The number of predicates, which must be equal or less than the existing count.

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

pack-priv Class PredicatedNodeTest.PredOwner

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

Field Summary

Modifier and TypeField and Description
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
PredOwner(int index)

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

Field Detail

m_indexback to summary
pack-priv int m_index

Constructor Detail

PredOwnerback to summary
pack-priv PredOwner(int index)

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)