Class LocalVariableReference
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.VariableReference
net.sf.saxon.expr.LocalVariableReference
- All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, BindingReference, InstructionInfo, Locator
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.
- See Also:
-
Field Summary
FieldsFields inherited from class VariableReference
binding, constantValue, displayName, staticType -
Constructor Summary
ConstructorsConstructorDescriptionCreate a local variable reference.LocalVariableReference(Binding binding) Create a LocalVariableReference bound to a given Binding -
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a clone copy of this VariableReferenceReturn the value of the variableintGet the slot number allocated to this local variablevoidsetSlotNumber(int slotNumber) Set the slot number for this local variable, that is, its position in the local stack frameMethods inherited from class VariableReference
addToPathMap, computeCardinality, computeSpecialProperties, equals, evaluateItem, explain, fixup, getBinding, getDisplayName, getImplementationMethod, getIntegerBounds, getIntrinsicDependencies, getItemType, hashCode, isFiltered, isFlattened, isInLoop, iterate, optimize, process, promote, refineVariableType, setFiltered, setFlattened, setStaticType, toString, typeCheckMethods inherited from class Expression
adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getExpressionName, getHostLanguage, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, iterateSubExpressions, markTailFunctionCalls, replaceSubExpression, resetLocalStaticProperties, setContainer, setEvaluationMethod, setLocationId, simplify, staticTypeCheck, suppressValidation, typeError
-
Field Details
-
slotNumber
int slotNumber
-
-
Constructor Details
-
LocalVariableReference
public LocalVariableReference()Create a local variable reference. The binding and slot number will be supplied later -
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- Overrides:
copyin classVariableReference- Returns:
- the cloned copy
-
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
-