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

public Class MatchPatternIterator

extends LocPathIterator
Class Inheritance
Imports
com.sun.org.apache.xml.internal.dtm.Axis, .DTM, .DTMAxisTraverser, .DTMIterator, com.sun.org.apache.xpath.internal.XPathContext, com.sun.org.apache.xpath.internal.compiler.Compiler, .OpMap, com.sun.org.apache.xpath.internal.objects.XObject, com.sun.org.apache.xpath.internal.patterns.NodeTest, .StepPattern

This class treats a LocationPath as a filtered iteration over the tree, evaluating each node in a super axis traversal against the LocationPath interpreted as a match pattern. This class is useful to find nodes in document order that are complex paths whose steps probably criss-cross each other.

Field Summary

Modifier and TypeField and Description
private static final boolean
DEBUG

DEBUG flag for diagnostic dumps.

protected StepPattern
m_pattern

This is the select pattern, translated into a match pattern.

protected int
m_superAxis

The traversal axis from where the nodes will be filtered.

protected DTMAxisTraverser
m_traverser

The DTM inner traversal class, that corresponds to the super axis.

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
MatchPatternIterator(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 bits that give general information about the LocationPath.
analysis
)

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

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
,
XPathContext xctxt)

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

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.

protected int

Returns:

The next node on the axis, or DTM.NULL.
getNextNode
()

Get the next node via getNextXXX.

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
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:
allowDetachToReleaseasIteratorasNodeboolcallVisitorscloneWithResetexecuteexecuteCharsToContentHandlergetAnalysisBitsgetAxisgetContextgetCurrentContextNodegetCurrentNodegetCurrentPosgetDTMgetDTMManagergetExpandEntityReferencesgetFiltergetFoundLastgetIsTopLevelgetLastPosgetLengthgetPrefixResolvergetRootgetWhatToShowgetXPathContextincrementCurrentPosisDocOrderedisFreshisMutableisNodesetExpritempreviousNoderesetreturnNextNoderunTosetCurrentContextNodesetCurrentPossetEnvironmentsetIsTopLevelsetItemsetNextPositionsetShouldCacheNodessize

Field Detail

DEBUGback to summary
private static final boolean DEBUG

DEBUG flag for diagnostic dumps.

m_patternback to summary
protected StepPattern m_pattern

This is the select pattern, translated into a match pattern.

m_superAxisback to summary
protected int m_superAxis

The traversal axis from where the nodes will be filtered.

m_traverserback to summary
protected DTMAxisTraverser m_traverser

The DTM inner traversal class, that corresponds to the super axis.

Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

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

Constructor Detail

MatchPatternIteratorback to summary
pack-priv MatchPatternIterator(Compiler compiler, int opPos, int analysis) throws TransformerException

Create a LocPathIterator object, 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.

analysis:int

Analysis bits that give general information about the LocationPath.

Method Detail

acceptNodeback to summary
public short acceptNode(int n, XPathContext xctxt)

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 .

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.

getNextNodeback to summary
protected int getNextNode()

Get the next node via getNextXXX. Bottlenecked for derived class override.

Returns:int

The next node on the axis, or DTM.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.

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.