Package net.sf.saxon.expr.instruct
Class WithParam
java.lang.Object
net.sf.saxon.expr.instruct.WithParam
An object derived from a xsl:with-param element in the stylesheet.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WithParam[]
copy
(Expression parent, WithParam[] params, RebindingMap rebindings) Static method to copy a set of parametersstatic void
exportParameters
(WithParam[] params, ExpressionPresenter out, boolean tunnel) Static method to export a set of parametersstatic void
gatherOperands
(Expression parent, WithParam[] params, List<Operand> list) Static method to gather the XPath expressions used in an array of WithParam parameters (add them to the supplied list)Get the evaluation mode of the variableint
Get the required type of this variableGet the expression to which this variable is boundGet the select operandgetSelectValue
(XPathContext context) Evaluate the variable.int
Get the slot number allocated to this variable.Get the name of this variableboolean
Ask whether static type checking has been donestatic void
optimize
(ExpressionVisitor visitor, WithParam[] params, ContextItemStaticInfo contextItemType) Static method to optimize a set of with-param elementsvoid
setRequiredType
(SequenceType required) Set the required type of this variablevoid
setSelectExpression
(Expression parent, Expression select) Set the expression to which this variable is boundvoid
setSlotNumber
(int s) Set the slot number of this variablevoid
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 checkvoid
Set the name of the variablestatic void
Static method to simplify a set of with-param elementsstatic void
typeCheck
(WithParam[] params, ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) Static method to typecheck a set of with-param elements
-
Field Details
-
EMPTY_ARRAY
-
-
Constructor Details
-
WithParam
public WithParam()
-
-
Method Details
-
setSelectExpression
Set the expression to which this variable is bound- Parameters:
parent
- the parent expressionselect
- the initializing expression
-
getSelectOperand
Get the select operand- Returns:
- the select operand
-
getSelectExpression
Get the expression to which this variable is bound- Returns:
- the initializing expression
-
setRequiredType
Set the required type of this variable- Parameters:
required
- the required type
-
getRequiredType
Get the required type of this variable- Returns:
- the required type
-
getSlotNumber
public int getSlotNumber()Get the slot number allocated to this variable. This is used only for xsl:iterate and xsl:evaluate; template parameters are identified by name, not by slot number.- Returns:
- the slot number, that is the position allocated to the variable on its stack frame
-
setSlotNumber
public void setSlotNumber(int s) Set the slot number of this variable- Parameters:
s
- the slot number, that is, the position allocated to this variable on its stack frame
-
setVariableQName
Set the name of the variable- Parameters:
s
- the name of the variable (a QName)
-
getVariableQName
Get the name of this variable- Returns:
- the name of this variable (a QName)
-
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
-
getInstructionNameCode
public int getInstructionNameCode() -
simplify
Static method to simplify a set of with-param elements- Parameters:
params
- the set of parameters to be simplified- Throws:
XPathException
- if a static error is found
-
typeCheck
public static void typeCheck(WithParam[] params, ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException Static method to typecheck a set of with-param elements- Parameters:
params
- the set of parameters to be checkedvisitor
- the expression visitorcontextItemType
- static information about the context item type and existence- Throws:
XPathException
- if a static error is found
-
optimize
public static void optimize(ExpressionVisitor visitor, WithParam[] params, ContextItemStaticInfo contextItemType) throws XPathException Static method to optimize a set of with-param elements- Parameters:
visitor
- the expression visitorparams
- the set of parameters to be optimizedcontextItemType
- static information about the context item type and existence- Throws:
XPathException
- if a static error is found
-
getEvaluator
Get the evaluation mode of the variable- Returns:
- the evaluator object
-
copy
Static method to copy a set of parameters- Parameters:
parent
- the new parent expressionparams
- the parameters to be copiedrebindings
- the rebinding map- Returns:
- the resulting copy
-
gatherOperands
Static method to gather the XPath expressions used in an array of WithParam parameters (add them to the supplied list)- Parameters:
parent
- the containing expressionparams
- the set of with-param elements to be searchedlist
- the list to which the subexpressions will be added
-
exportParameters
public static void exportParameters(WithParam[] params, ExpressionPresenter out, boolean tunnel) throws XPathException Static method to export a set of parameters- Parameters:
params
- the set of parameters to be exportedout
- the destination for the outputtunnel
- true if these are tunnel parameters- Throws:
XPathException
- if any error occurs
-
getSelectValue
Evaluate the variable. That is, get the value of the select expression if present or the content of the element otherwise, either as a tree or as a sequence- Parameters:
context
- the XPath dynamic context- Returns:
- the result of evaluating the variable
- Throws:
XPathException
- if evaluation of the select expression fails with a dynamic error
-
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
-