Package net.sf.saxon.expr
Class GlobalVariableReference
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.VariableReference
net.sf.saxon.expr.GlobalVariableReference
- All Implemented Interfaces:
BindingReference
,ComponentInvocation
,ExportAgent
,Locatable
,IdentityComparable
,Traceable
A reference to a global variable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Elaborator for a global variable reference, for example$globalVar
. -
Field Summary
Fields inherited from class net.sf.saxon.expr.VariableReference
binding, constantValue, staticType
Fields 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
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncopy
(RebindingMap rebindings) Create a clone copy of this VariableReferenceEvaluate this variablevoid
Diagnostic print of expression structure.int
Get the binding slot to be used.Make an elaborator for this expressionGet a name identifying the kind of expression, in terms meaningful to a user.Get the target component if this is known in advance, that is, if the target component is private or final, or in some other cases such as xsl:original.Get the symbolic name of the component that this invocation referencesvoid
setBindingSlot
(int slot) Set the binding slot to be used.void
Methods inherited from class net.sf.saxon.expr.VariableReference
addToPathMap, computeCardinality, computeHashCode, computeSpecialProperties, copyFrom, equals, evaluateItem, fixup, getBinding, 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, typeCheck
Methods 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, withLocation
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
Constructor Details
-
Method Details
-
copy
Description copied from class:VariableReference
Create a clone copy of this VariableReference- Specified by:
copy
in classVariableReference
- Parameters:
rebindings
- variables that need to switch to new bindings- Returns:
- the cloned copy
-
setBindingSlot
public void setBindingSlot(int slot) Set the binding slot to be used. This is the offset within the binding vector of the containing component where the actual target component is to be found. The target template is not held directly in the invocation instruction/expression itself because it can be overridden in a using package.- Specified by:
setBindingSlot
in interfaceComponentInvocation
- Parameters:
slot
- the offset in the binding vector of the containing package where the target component can be found.
-
getBindingSlot
public int getBindingSlot()Get the binding slot to be used. This is the offset within the binding vector of the containing component where the actual target component is to be found.- Specified by:
getBindingSlot
in interfaceComponentInvocation
- Returns:
- the offset in the binding vector of the containing package where the target component can be found.
-
getSymbolicName
Get the symbolic name of the component that this invocation references- Specified by:
getSymbolicName
in interfaceComponentInvocation
- Returns:
- the symbolic name of the target component
-
setTarget
-
getTarget
-
getFixedTarget
Description copied from interface:ComponentInvocation
Get the target component if this is known in advance, that is, if the target component is private or final, or in some other cases such as xsl:original. Otherwise, return null.- Specified by:
getFixedTarget
in interfaceComponentInvocation
- Returns:
- the bound component if the binding has been fixed
-
evaluateVariable
Evaluate this variable- Overrides:
evaluateVariable
in classVariableReference
- Parameters:
c
- the XPath dynamic context- Returns:
- the value of the variable
- Throws:
XPathException
- if any error occurs
-
export
Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.- Specified by:
export
in interfaceExportAgent
- Overrides:
export
in classVariableReference
- Parameters:
out
- the expression presenter used to display the structure- Throws:
XPathException
- if the export fails, for example if an expression is found that won't work in the target environment.
-
getPreconditions
-
getExpressionName
Get a name identifying the kind of expression, in terms meaningful to a user.- Overrides:
getExpressionName
in 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:
getElaborator
in classExpression
- Returns:
- a suitable elaborator
-