Package net.sf.saxon.expr
Interface Binding
- All Known Subinterfaces:
LocalBinding
- All Known Implementing Classes:
Assignation,EagerLetExpression,ForExpression,GlobalParam,GlobalVariable,LetExpression,LocalParam,LocalVariableBinding,OuterForExpression,ParserExtension.TemporaryXSLTVariableBinding,QuantifiedExpression,UndeclaredVariable,UserFunctionParameter,XPathVariable
public interface Binding
Binding is a interface used to represent the run-time properties and methods
associated with a variable: specifically, a method to get the value
of the variable.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddReference(VariableReference ref, boolean isLoopingReference) Register a variable reference that refers to the variable bound in this expressionevaluateVariable(XPathContext context) Evaluate the variableGet the declared type of the variableGet the name of the variablebooleanTest whether it is permitted to assign to the variable using the saxon:assign extension element.booleanisGlobal()Indicate whether the binding is local or global.
-
Method Details
-
getRequiredType
SequenceType getRequiredType()Get the declared type of the variable- Returns:
- the declared type
-
evaluateVariable
Evaluate the variable- Parameters:
context- the XPath dynamic evaluation context- Returns:
- the result of evaluating the variable
- Throws:
XPathException- if an error occurs while evaluating the variable
-
isGlobal
boolean isGlobal()Indicate whether the binding is local or global. A global binding is one that has a fixed value for the life of a query or transformation; any other binding is local.- Returns:
- true if the binding is global
-
isAssignable
boolean isAssignable()Test whether it is permitted to assign to the variable using the saxon:assign extension element. This will only be for an XSLT global variable where the extra attribute saxon:assignable="yes" is present.- Returns:
- true if the binding is assignable
-
getVariableQName
StructuredQName getVariableQName()Get the name of the variable- Returns:
- the name of the variable, as a structured QName
-
addReference
Register a variable reference that refers to the variable bound in this expression- Parameters:
ref- the variable referenceisLoopingReference- - true if the reference occurs within a loop, such as the predicate of a filter expression
-