net.sf.saxon.expr

Class SuppliedParameterReference

public class SuppliedParameterReference extends ComputedExpression

Supplied parameter reference: this is an internal expression used to refer to the value of the n'th parameter supplied on a template call (apply-templates). It is used within a type-checking expression designed to check the consistency of the supplied value with the required type. This type checking is all done at run-time, because the binding of apply-templates to actual template rules is entirely dynamic.
Field Summary
intslotNumber
Constructor Summary
SuppliedParameterReference(int slot)
Constructor
Method Summary
intcomputeCardinality()
Get the static cardinality
voiddisplay(int level, NamePool pool, PrintStream out)
Diagnostic print of expression structure
booleanequals(Object other)
Test if this expression is the same as another expression.
ItemevaluateItem(XPathContext c)
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the expression, if possible.
SequenceIteratoriterate(XPathContext c)
Get the value of this expression in a given context.
Expressionoptimize(Optimizer opt, StaticContext env, ItemType contextItemType)
Expressionsimplify(StaticContext env)
Simplify the expression.
ExpressiontypeCheck(StaticContext env, ItemType contextItemType)

Field Detail

slotNumber

int slotNumber

Constructor Detail

SuppliedParameterReference

public SuppliedParameterReference(int slot)
Constructor

Parameters: slot identifies this parameter

Method Detail

computeCardinality

public int computeCardinality()
Get the static cardinality

Returns: ZERO_OR_MORE, because we don't know the type of the supplied value in advance.

display

public void display(int level, NamePool pool, PrintStream out)
Diagnostic print of expression structure

equals

public boolean equals(Object other)
Test if this expression is the same as another expression. (Note, we only compare expressions that have the same static and dynamic context).

evaluateItem

public Item evaluateItem(XPathContext c)

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the expression, if possible.

Parameters: th

Returns: Type.ITEM, because we don't know the type of the supplied value in advance.

iterate

public SequenceIterator iterate(XPathContext c)
Get the value of this expression in a given context.

Parameters: c the XPathContext which contains the relevant variable bindings

Returns: the value of the variable, if it is defined

Throws: XPathException if the variable is undefined

optimize

public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)

simplify

public Expression simplify(StaticContext env)
Simplify the expression. Does nothing.

typeCheck

public Expression typeCheck(StaticContext env, ItemType contextItemType)