net.sf.saxon.instruct

Class WithParam

Implemented Interfaces:
Binding, Serializable, SourceLocator, EvaluableItem, InstructionInfoProvider, SequenceIterable, TailCallReturner

public class WithParam
extends GeneralVariable

An instruction derived from a xsl:with-param element in the stylesheet.

Field Summary

Fields inherited from class net.sf.saxon.instruct.GeneralVariable

evaluationMode, referenceCount, slotNumber, variableQName

Fields inherited from class net.sf.saxon.expr.Expression

EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD, locationId, staticProperties

Constructor Summary

WithParam()
Create a general variable

Method Summary

static void
displayExpressions(WithParam[] params, ExpressionPresenter out)
DIsplay the parameter expressions
ValueRepresentation
evaluateVariable(XPathContext context)
Evaluate the variable (method exists only to satisfy the interface)
int
getInstructionNameCode()
Get the name of this instruction (that is xsl:variable, xsl:param etc) for diagnostics
int
getParameterId()
Get the parameter id, which is essentially an alias for the parameter name, unique within a stylesheet
static void
getXPathExpressions(WithParam[] params, List list)
Get the XPath expressions used in an array of WithParam parameters (add them to the supplied list)
static void
optimize(ExpressionVisitor visitor, WithParam[] params, ItemType contextItemType)
TailCall
processLeavingTail(XPathContext context)
static void
promoteParams(WithParam[] params, PromotionOffer offer)
Promote the expressions in a set of with-param elements.
static boolean
replaceXPathExpression(WithParam[] params, Expression original, Expression replacement)
Replace a subexpression
void
setParameterId(int id)
Allocate a number which is essentially an alias for the parameter name, unique within a stylesheet
static void
simplify(WithParam[] params, ExpressionVisitor visitor)
static void
typeCheck(WithParam[] params, ExpressionVisitor visitor, ItemType contextItemType)

Methods inherited from class net.sf.saxon.instruct.GeneralVariable

copy, evaluateItem, explain, getCardinality, getEvaluationMode, getInstructionNameCode, getItemType, getLocalSlotNumber, getRequiredType, getSelectExpression, getSelectValue, getSlotNumber, getVariableQName, init, isAssignable, isGlobal, isImplicitlyRequiredParam, isRequiredParam, isTunnelParam, iterate, iterateSubExpressions, optimize, promoteInst, replaceSubExpression, setAssignable, setImplicitlyRequiredParam, setReferenceCount, setRequiredParam, setRequiredType, setSelectExpression, setSlotNumber, setTunnel, setVariableQName, simplify, typeCheck

Methods inherited from class net.sf.saxon.instruct.Instruction

assembleParams, assembleTunnelParams, computeCardinality, computeSpecialProperties, createsNewNodes, dynamicError, evaluateAsString, evaluateItem, getImplementationMethod, getInstructionInfo, getInstructionNameCode, getItemType, getSourceLocator, isXSLT, iterate, process, processLeavingTail, promote, promoteInst, simplify

Methods inherited from class net.sf.saxon.expr.Expression

addToPathMap, adoptChildExpression, checkPermittedContents, computeCardinality, computeDependencies, computeSpecialProperties, computeStaticProperties, copy, display, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, explain, findParentOf, getCardinality, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getItemType, getLineNumber, getLocationId, getLocationProvider, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, iterate, iterateEvents, iterateSubExpressions, markTailFunctionCalls, optimize, process, promote, replaceSubExpression, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, toString, typeCheck, typeError

Constructor Details

WithParam

public WithParam()
Create a general variable

Method Details

displayExpressions

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

evaluateVariable

public ValueRepresentation evaluateVariable(XPathContext context)
            throws XPathException
Evaluate the variable (method exists only to satisfy the interface)
Specified by:
evaluateVariable in interface Binding

getInstructionNameCode

public int getInstructionNameCode()
Get the name of this instruction (that is xsl:variable, xsl:param etc) for diagnostics
Overrides:
getInstructionNameCode in interface GeneralVariable
Returns:
the name of this instruction, as a name pool name code

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)

optimize

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

processLeavingTail

public TailCall processLeavingTail(XPathContext context)
            throws XPathException
Specified by:
processLeavingTail in interface TailCallReturner
Overrides:
processLeavingTail in interface Instruction

promoteParams

public static void promoteParams(WithParam[] params,
                                 PromotionOffer offer)
            throws XPathException
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

simplify

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

typeCheck

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