net.sf.saxon.instruct
public abstract class GeneralVariable extends Instruction implements Binding
Field Summary | |
---|---|
protected int | evaluationMode |
protected int | referenceCount |
SequenceType | requiredType |
Expression | select |
protected int | slotNumber |
protected StructuredQName | variableQName |
Constructor Summary | |
---|---|
GeneralVariable()
Create a general variable |
Method Summary | |
---|---|
Expression | copy()
Copy an expression. |
Item | evaluateItem(XPathContext context)
Evaluate an expression as a single item. |
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
int | getCardinality()
Get the cardinality of the result of this instruction. |
int | getEvaluationMode()
Get the evaluation mode of the variable |
int | getInstructionNameCode()
Get the name of this instruction (that is xsl:variable, xsl:param etc) for diagnostics |
ItemType | getItemType(TypeHierarchy th)
Get the type of the result of this instruction. |
int | getLocalSlotNumber()
If this is a local variable held on the local stack frame, return the corresponding slot number.
|
SequenceType | getRequiredType()
Get the required type of this variable |
Expression | getSelectExpression()
Get the expression to which this variable is bound |
ValueRepresentation | getSelectValue(XPathContext context)
Evaluate the variable. |
int | getSlotNumber()
Get the slot number allocated to this variable |
StructuredQName | getVariableQName()
Get the name of this variable |
void | init(Expression select, StructuredQName qName)
Initialize the properties of the variable |
boolean | isAssignable()
Test whether it is permitted to assign to the variable using the saxon:assign
extension element. |
boolean | isGlobal() |
boolean | isImplicitlyRequiredParam()
Ask whether this variable represents a parameter that is implicitly required, because there is no usable
default value |
boolean | isRequiredParam()
Ask whether this variable represents a required parameter |
boolean | isTunnelParam()
Ask whether this variable represents a tunnel parameter |
SequenceIterator | iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
Iterator<Expression> | iterateSubExpressions()
Get all the XPath expressions associated with this instruction
(in XSLT terms, the expression present on attributes of the instruction,
as distinct from the child instructions in a sequence construction) |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) |
protected void | promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites. |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression |
void | setAssignable(boolean assignable)
Indicate whether this variable is assignable using saxon:assign |
void | setImplicitlyRequiredParam(boolean requiredParam)
Indicate that this variable represents a parameter that is implicitly required (because there is no
usable default value) |
void | setReferenceCount(int refCount)
Set the nominal number of references to this variable |
void | setRequiredParam(boolean requiredParam)
Indicate that this variable represents a required parameter |
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 |
void | setTunnel(boolean tunnel)
Indicate whether this variable represents a tunnel parameter |
void | setVariableQName(StructuredQName s)
Set the name of the variable |
Expression | simplify(ExpressionVisitor visitor)
Simplify this expression |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType) |
Returns: the copy of the original expression
Parameters: context The context in which the expression is to be evaluated
Returns: the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
Throws: XPathException if any dynamic error occurs evaluating the expression
Returns: the empty cardinality.
Returns: the evaluation mode (a constant in ExpressionTool
Returns: the name of this instruction, as a name pool name code
Parameters: th the type hierarchy cache
Returns: the empty type.
Returns: the required type
Returns: the initializing expression
Parameters: context the XPath dynamic context
Returns: the result of evaluating the variable
Returns: the slot number, that is the position allocated to the variable on its stack frame
Returns: the name of this variable (a QName)
Parameters: select the expression to which the variable is bound qName the name of the variable
Returns: true if this variable is an implicitly required parameter
Returns: true if this is a required parameter
Returns: true if this is a tunnel parameter
Parameters: context supplies the context for evaluation
Returns: a SequenceIterator that can be used to iterate over the result of the expression
Throws: XPathException if any dynamic error occurs evaluating the expression
Parameters: offer The type of rewrite being offered
Throws: XPathException
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found
Parameters: assignable true if this variable is assignable
Parameters: requiredParam true if this is an implicitly required parameter
Parameters: refCount the nominal number of references
Parameters: requiredParam true if this is a required parameter
Parameters: required the required type
Parameters: select the initializing expression
Parameters: s the slot number, that is, the position allocated to this variable on its stack frame
Parameters: tunnel true if this is a tunnel parameter
Parameters: s the name of the variable (a QName)
Parameters: visitor an expression
Returns: the simplified expression
Throws: XPathException