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 classElaborator for a global variable reference, for example$globalVar. -
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
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncopy(RebindingMap rebindings) Create a clone copy of this VariableReferenceEvaluate this variablevoidDiagnostic print of expression structure.intGet 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 referencesvoidsetBindingSlot(int slot) Set the binding slot to be used.voidMethods 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, 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
-
GlobalVariableReference
-
GlobalVariableReference
-
-
Method Details
-
copy
Description copied from class:VariableReferenceCreate a clone copy of this VariableReference- Specified by:
copyin 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:
setBindingSlotin 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:
getBindingSlotin 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:
getSymbolicNamein interfaceComponentInvocation- Returns:
- the symbolic name of the target component
-
setTarget
-
getTarget
-
getFixedTarget
Description copied from interface:ComponentInvocationGet 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:
getFixedTargetin interfaceComponentInvocation- Returns:
- the bound component if the binding has been fixed
-
evaluateVariable
Evaluate this variable- Overrides:
evaluateVariablein 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:
exportin interfaceExportAgent- Overrides:
exportin 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:
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
-