Package net.sf.saxon.expr
Class LocalVariableReference
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.VariableReference
net.sf.saxon.expr.LocalVariableReference
- All Implemented Interfaces:
BindingReference,ExportAgent,Locatable,IdentityComparable,Traceable
Variable reference: a reference to a local variable. This subclass of VariableReference
bypasses the Binding object to get the value directly from the relevant slot in the local
stackframe.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classElaborator for a local variable reference, for example$var. -
Field Summary
Fields inherited from class net.sf.saxon.expr.VariableReference
binding, constantValue, staticTypeFields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD -
Constructor Summary
ConstructorsConstructorDescriptionLocalVariableReference(LocalBinding binding) Create a LocalVariableReference bound to a given BindingCreate a local variable reference. -
Method Summary
Modifier and TypeMethodDescriptioncopy(RebindingMap rebindings) Create a clone copy of this VariableReferenceReturn the value of the variableGet the object bound to the variableMake an elaborator for this expressionGet a name identifying the kind of expression, in terms meaningful to a user.intGet the slot number allocated to this local variablevoidsetBinding(LocalBinding binding) voidsetSlotNumber(int slotNumber) Set the slot number for this local variable, that is, its position in the local stack frameMethods inherited from class net.sf.saxon.expr.VariableReference
addToPathMap, computeCardinality, computeHashCode, computeSpecialProperties, copyFrom, equals, evaluateItem, export, fixup, getDisplayName, getEQName, getImplementationMethod, getIntegerBounds, getIntrinsicDependencies, getItemType, getNetCost, getScopingExpression, getStaticUType, getStreamerName, getVariableName, isFiltered, isFlattened, isInLoop, iterate, optimize, process, recomputeInLoop, refineVariableType, setFiltered, setFlattened, setInLoop, setStaticType, setVariableName, supportsLazyEvaluation, toShortString, toString, typeCheckMethods inherited from class net.sf.saxon.expr.Expression
adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, dispatchTailCall, dynamicError, effectiveBooleanValue, evaluateAsString, explain, getCardinality, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getLocalRetainedStaticContext, getLocation, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, makeElaborator, markTailFunctionCalls, operandList, operands, operandSparseList, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, typeCheckChildren, typeError, unordered, verifyParentPointers, withLocationMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
Constructor Details
-
LocalVariableReference
Create a local variable reference. The binding and slot number will be supplied later- Parameters:
name- the name of the local variable
-
LocalVariableReference
Create a LocalVariableReference bound to a given Binding- Parameters:
binding- the binding (that is, the declaration of this local variable)
-
-
Method Details
-
copy
Create a clone copy of this VariableReference- Specified by:
copyin classVariableReference- Parameters:
rebindings- a mutable list of (old binding, new binding) pairs that is used to update the bindings held in any local variable references that are copied.- Returns:
- the cloned copy
-
setBinding
-
getBinding
Description copied from class:VariableReferenceGet the object bound to the variable- Overrides:
getBindingin classVariableReference- Returns:
- the Binding which declares this variable and associates it with a value
-
setSlotNumber
public void setSlotNumber(int slotNumber) Set the slot number for this local variable, that is, its position in the local stack frame- Parameters:
slotNumber- the slot number to be used
-
getSlotNumber
public int getSlotNumber()Get the slot number allocated to this local variable- Returns:
- the slot number
-
evaluateVariable
Return the value of the variable- Overrides:
evaluateVariablein classVariableReference- Parameters:
c- the XPath dynamic context- Returns:
- the value of the variable
- Throws:
XPathException- if any dynamic error occurs while evaluating the variable
-
getExpressionName
Get a name identifying the kind of expression, in terms meaningful to a user.- Overrides:
getExpressionNamein classVariableReference- Returns:
- a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in export() output displaying the expression.
-
getElaborator
Make an elaborator for this expression- Overrides:
getElaboratorin classExpression- Returns:
- a suitable elaborator
-