APIdia Launch Partner
Top Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.compiler

pack-priv final Class Step

extends RelativeLocationPath
Class Inheritance
Imports
com.sun.org.apache.bcel.internal.generic.ALOAD, .ASTORE, .CHECKCAST, .ConstantPoolGen, .ICONST, .ILOAD, .INVOKEINTERFACE, .INVOKESPECIAL, .ISTORE, .InstructionList, .LocalVariableGen, .NEW, .PUSH, com.sun.org.apache.xalan.internal.xsltc.DOM, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator, .MethodGenerator, .Type, .TypeCheckError, .Util, com.sun.org.apache.xml.internal.dtm.Axis, .DTM, java.util.List

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen

Field Summary

Modifier and TypeField and Description
private int
_axis

This step's axis as defined in class Axis.

private boolean
_hadPredicates

Some simple predicates can be handled by this class (and not by the Predicate class) and will be removed from the above vector as they are handled.

private int
_nodeType

Type of the node test.

private List<Predicate>
_predicates

A vector of predicates (filters) defined on this step - may be null

Constructor Summary

AccessConstructor and Description
public
Step(int axis, int nodeType, List<Predicate> predicates)

Method Summary

Modifier and TypeMethod and Description
public void
addPredicates(List<Predicate> predicates)

Returns the vector containing all predicates for this step.

public int
getAxis()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.RelativeLocationPath.getAxis.

Define the axis (defined in Axis class) for this step

public int
getNodeType()

Returns the node-type for this step

public List<Predicate>
getPredicates()

Returns the vector containing all predicates for this step.

private boolean
hasParentLocationPath()

Returns 'true' if this step has a parent location path.

private boolean
hasParentPattern()

Returns 'true' if this step has a parent pattern.

private boolean
hasPredicates()

Returns 'true' if this step has any predicates

public boolean
isAbbreviatedDDot()

True if this step is the abbreviated step '..'

public boolean
isAbbreviatedDot()

True if this step is the abbreviated step '.'

private boolean
isPredicate()

Returns 'true' if this step is used within a predicate

public void
setAxis(int axis)

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.RelativeLocationPath.setAxis.

Get the axis (defined in Axis class) for this step

public void
setParser(Parser parser)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.setParser.

Set the parser for this element and all child predicates

public String
toString()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.toString.

Returns a string representation of this step.

public void
translate(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.translate.

Translate a step by pushing the appropriate iterator onto the stack.

public void
translatePredicates(ClassGenerator classGen, MethodGenerator methodGen, int predicateIndex)

Translate a sequence of predicates.

private void
translateStep(ClassGenerator classGen, MethodGenerator methodGen, int predicateIndex)

public Type

Field Detail

_axisback to summary
private int _axis

This step's axis as defined in class Axis.

_hadPredicatesback to summary
private boolean _hadPredicates

Some simple predicates can be handled by this class (and not by the Predicate class) and will be removed from the above vector as they are handled. We use this boolean to remember if we did have any predicates.

_nodeTypeback to summary
private int _nodeType

Type of the node test.

_predicatesback to summary
private List<Predicate> _predicates

A vector of predicates (filters) defined on this step - may be null

Constructor Detail

Stepback to summary
public Step(int axis, int nodeType, List<Predicate> predicates)

Method Detail

addPredicatesback to summary
public void addPredicates(List<Predicate> predicates)

Returns the vector containing all predicates for this step.

getAxisback to summary
public int getAxis()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.RelativeLocationPath.getAxis.

Define the axis (defined in Axis class) for this step

getNodeTypeback to summary
public int getNodeType()

Returns the node-type for this step

getPredicatesback to summary
public List<Predicate> getPredicates()

Returns the vector containing all predicates for this step.

hasParentLocationPathback to summary
private boolean hasParentLocationPath()

Returns 'true' if this step has a parent location path.

hasParentPatternback to summary
private boolean hasParentPattern()

Returns 'true' if this step has a parent pattern. This method will return 'false' if this step occurs on its own under an element like <xsl:for-each> or <xsl:apply-templates>.

hasPredicatesback to summary
private boolean hasPredicates()

Returns 'true' if this step has any predicates

isAbbreviatedDDotback to summary
public boolean isAbbreviatedDDot()

True if this step is the abbreviated step '..'

isAbbreviatedDotback to summary
public boolean isAbbreviatedDot()

True if this step is the abbreviated step '.'

isPredicateback to summary
private boolean isPredicate()

Returns 'true' if this step is used within a predicate

setAxisback to summary
public void setAxis(int axis)

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.RelativeLocationPath.setAxis.

Get the axis (defined in Axis class) for this step

setParserback to summary
public void setParser(Parser parser)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.setParser.

Set the parser for this element and all child predicates

toStringback to summary
public String toString()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.toString.

Returns a string representation of this step.

translateback to summary
public void translate(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.translate.

Translate a step by pushing the appropriate iterator onto the stack. The abbreviated steps '.' and '@attr' do not create new iterators if they are not part of a LocationPath and have no filters. In these cases a node index instead of an iterator is pushed onto the stack.

translatePredicatesback to summary
public void translatePredicates(ClassGenerator classGen, MethodGenerator methodGen, int predicateIndex)

Translate a sequence of predicates. Each predicate is translated by constructing an instance of CurrentNodeListIterator which is initialized from another iterator (recursive call), a filter and a closure (call to translate on the predicate) and "this".

translateStepback to summary
private void translateStep(ClassGenerator classGen, MethodGenerator methodGen, int predicateIndex)
Annotations
@SuppressWarnings:fallthrough
typeCheckback to summary
public Type typeCheck(SymbolTable stable) throws TypeCheckError

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.typeCheck.

Type check this step. The abbreviated steps '.' and '@attr' are assigned type node if they have no predicates. All other steps have type node-set.