net.sf.saxon.instruct

Class WithParam

public class WithParam extends GeneralVariable

An instruction derived from a xsl:with-param element in the stylesheet.
Field Summary
intparameterId
booleantypeChecked
Constructor Summary
WithParam()
Method Summary
static voiddisplayExpressions(WithParam[] params, ExpressionPresenter out)
DIsplay the parameter expressions
ValueRepresentationevaluateVariable(XPathContext context)
Evaluate the variable (method exists only to satisfy the interface)
intgetInstructionNameCode()
intgetParameterId()
Get the parameter id, which is essentially an alias for the parameter name, unique within a stylesheet
static voidgetXPathExpressions(WithParam[] params, List list)
Get the XPath expressions used in an array of WithParam parameters (add them to the supplied list)
booleanisTypeChecked()
Ask whether static type checking has been done
static voidoptimize(ExpressionVisitor visitor, WithParam[] params, ItemType contextItemType)
TailCallprocessLeavingTail(XPathContext context)
static voidpromoteParams(Expression parent, WithParam[] params, PromotionOffer offer)
Promote the expressions in a set of with-param elements.
static booleanreplaceXPathExpression(WithParam[] params, Expression original, Expression replacement)
Replace a subexpression
voidsetParameterId(int id)
Allocate a number which is essentially an alias for the parameter name, unique within a stylesheet
voidsetTypeChecked(boolean checked)
Say whether this parameter will have been typechecked by the caller to ensure it satisfies the required type, in which case the callee need not do a dynamic type check
static voidsimplify(WithParam[] params, ExpressionVisitor visitor)
static voidtypeCheck(WithParam[] params, ExpressionVisitor visitor, ItemType contextItemType)

Field Detail

parameterId

int parameterId

typeChecked

boolean typeChecked

Constructor Detail

WithParam

public WithParam()

Method Detail

displayExpressions

public static void displayExpressions(WithParam[] params, ExpressionPresenter out)
DIsplay the parameter expressions

evaluateVariable

public ValueRepresentation evaluateVariable(XPathContext context)
Evaluate the variable (method exists only to satisfy the interface)

getInstructionNameCode

public int getInstructionNameCode()

getParameterId

public int getParameterId()
Get the parameter id, which is essentially an alias for the parameter name, unique within a stylesheet

Returns: the parameter id

getXPathExpressions

public static void getXPathExpressions(WithParam[] params, List list)
Get the XPath expressions used in an array of WithParam parameters (add them to the supplied list)

isTypeChecked

public boolean isTypeChecked()
Ask whether static type checking has been done

Returns: true if the caller has done static type checking against the type required by the callee

optimize

public static void optimize(ExpressionVisitor visitor, WithParam[] params, ItemType contextItemType)

processLeavingTail

public TailCall processLeavingTail(XPathContext context)

promoteParams

public static void promoteParams(Expression parent, WithParam[] params, PromotionOffer offer)
Promote the expressions in a set of with-param elements. This is a convenience method for use by subclasses.

replaceXPathExpression

public static boolean replaceXPathExpression(WithParam[] params, Expression original, Expression replacement)
Replace a subexpression

setParameterId

public void setParameterId(int id)
Allocate a number which is essentially an alias for the parameter name, unique within a stylesheet

Parameters: id the parameter id

setTypeChecked

public void setTypeChecked(boolean checked)
Say whether this parameter will have been typechecked by the caller to ensure it satisfies the required type, in which case the callee need not do a dynamic type check

Parameters: checked true if the caller has done static type checking against the required type

simplify

public static void simplify(WithParam[] params, ExpressionVisitor visitor)

typeCheck

public static void typeCheck(WithParam[] params, ExpressionVisitor visitor, ItemType contextItemType)