public class WithParam extends Object
Modifier and Type | Field and Description |
---|---|
static WithParam[] |
EMPTY_ARRAY |
Constructor and Description |
---|
WithParam() |
Modifier and Type | Method and Description |
---|---|
static WithParam[] |
copy(WithParam[] params)
Static method to copy a set of parameters
|
static void |
explainParameters(WithParam[] params,
ExpressionPresenter out)
Static method to explain a set of parameters
|
static void |
gatherOperands(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)
|
static void |
gatherXPathExpressions(WithParam[] params,
List<Expression> list)
Static method to gather the XPath expressions used in an array of WithParam parameters (add them to the supplied list)
|
int |
getEvaluationMode()
Get the evaluation mode of the variable
|
int |
getInstructionNameCode() |
SequenceType |
getRequiredType()
Get the required type of this variable
|
Expression |
getSelectExpression()
Get the expression to which this variable is bound
|
Sequence |
getSelectValue(XPathContext context)
Evaluate the variable.
|
int |
getSlotNumber()
Get the slot number allocated to this variable
|
StructuredQName |
getVariableQName()
Get the name of this variable
|
boolean |
isTypeChecked()
Ask whether static type checking has been done
|
static void |
optimize(ExpressionVisitor visitor,
WithParam[] params,
ContextItemStaticInfo contextItemType)
Static method to optimize a set of with-param elements
|
static void |
promoteParams(Expression parent,
WithParam[] params,
PromotionOffer offer)
Static method to do expression promotion on a set of with-param elements
|
static boolean |
replaceXPathExpression(WithParam[] params,
Expression original,
Expression replacement)
Static method to replace a subexpression within any parameter within which it is found
|
void |
setRequiredType(SequenceType required)
Set the required type of this variable
|
void |
setSelectExpression(Expression select)
Set the expression to which this variable is bound
|
void |
setSlotNumber(int s)
Set the slot number of this variable
|
static void |
setSlotNumbers(WithParam[] params) |
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
|
void |
setVariableQName(StructuredQName s)
Set the name of the variable
|
static void |
simplify(WithParam[] params,
ExpressionVisitor visitor)
Static method to simplify a set of with-param elements
|
static void |
typeCheck(WithParam[] params,
ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType)
Static method to typecheck a set of with-param elements
|
public static WithParam[] EMPTY_ARRAY
public void setSelectExpression(Expression select)
select
- the initializing expressionpublic Expression getSelectExpression()
public void setRequiredType(SequenceType required)
required
- the required typepublic SequenceType getRequiredType()
public int getSlotNumber()
public void setSlotNumber(int s)
s
- the slot number, that is, the position allocated to this variable on its stack framepublic void setVariableQName(StructuredQName s)
s
- the name of the variable (a QName)public StructuredQName getVariableQName()
public void setTypeChecked(boolean checked)
checked
- true if the caller has done static type checking against the required typepublic int getInstructionNameCode()
public static void simplify(WithParam[] params, ExpressionVisitor visitor) throws XPathException
params
- the set of parameters to be simplifiedvisitor
- the expression visitorXPathException
- if a static error is foundpublic static void typeCheck(WithParam[] params, ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
params
- the set of parameters to be checkedvisitor
- the expression visitorcontextItemType
- static information about the context item type and existenceXPathException
- if a static error is foundpublic static void optimize(ExpressionVisitor visitor, WithParam[] params, ContextItemStaticInfo contextItemType) throws XPathException
params
- the set of parameters to be optimizedvisitor
- the expression visitorcontextItemType
- static information about the context item type and existenceXPathException
- if a static error is foundpublic static void promoteParams(Expression parent, WithParam[] params, PromotionOffer offer) throws XPathException
parent
- the parent instruction (for example apply-templates or call-template)params
- the set of parameters to be be investigated for promotionoffer
- the promotion offer to be passed to subexpressionsXPathException
- if a static error is foundpublic static void setSlotNumbers(WithParam[] params)
public int getEvaluationMode()
ExpressionTool
public static WithParam[] copy(WithParam[] params)
params
- the parameters to be copiedpublic static void gatherXPathExpressions(WithParam[] params, List<Expression> list)
params
- the set of with-param elements to be searchedlist
- the list to which the subexpressions will be addedpublic static void gatherOperands(WithParam[] params, List<Operand> list)
params
- the set of with-param elements to be searchedlist
- the list to which the subexpressions will be addedpublic static void explainParameters(WithParam[] params, ExpressionPresenter out)
params
- the set of parameters to be explainedout
- the destination for the explanationpublic static boolean replaceXPathExpression(WithParam[] params, Expression original, Expression replacement)
params
- the set of parameters to be examinedoriginal
- the subexpression to be replacedreplacement
- the replacement expressionpublic Sequence getSelectValue(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
- if evaluation of the select expression fails
with a dynamic errorpublic boolean isTypeChecked()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.