Package net.sf.saxon.expr.instruct
Class Bindery
java.lang.Object
net.sf.saxon.expr.instruct.Bindery
The Bindery class holds information about variables and their values. It is
used only for global variables: local variables are held in the XPathContext object.
Variables are identified by a GlobalVariable
object. Values will always be of class Sequence
.
The Bindery is a run-time object, but slot numbers within the bindery are allocated to global variables at compile time. Because XSLT packages can be separately compiled, each package needs to have its own bindery.
From Saxon 9.7 there is one Bindery for the global variables in each separately-compiled package.
The Bindery is no longer used to hold supplied values of global parameters, but it does hold their
values after initialization, treating them as normal global variables. Management of dependencies
among global variables, and checking for dynamic circularities, has been moved to the Controller
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A value that can be saved in a global variable to indicate that evaluation failed, and that subsequent attempts at evaluation should also fail -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGlobalVariable
(int slot) Get the value of a global variable whose slot number is knownGet all the global variables, as an array.getGlobalVariableValue
(GlobalVariable binding) Get the value of a global variablesaveGlobalVariableValue
(GlobalVariable binding, GroundedValue value) Save the value of a global variable, and mark evaluation as complete.void
setGlobalVariable
(GlobalVariable binding, GroundedValue value) Provide a value for a global variablevoid
setGlobalVariableValue
(int slot, GroundedValue value)
-
Constructor Details
-
Bindery
-
-
Method Details
-
setGlobalVariable
Provide a value for a global variable- Parameters:
binding
- identifies the variablevalue
- the value of the variable
-
saveGlobalVariableValue
Save the value of a global variable, and mark evaluation as complete.- Parameters:
binding
- the global variable in questionvalue
- the value that this thread has obtained by evaluating the variable- Returns:
- the value actually given to the variable. Exceptionally this will be different from the supplied value if another thread has evaluated the same global variable concurrently. The returned value should be used in preference, to ensure that all threads agree on the value. They could be different if for example the variable is initialized using the collection() function.
-
setGlobalVariableValue
-
getGlobalVariableValue
Get the value of a global variable- Parameters:
binding
- the Binding that establishes the unique instance of the variable- Returns:
- the Value of the variable if defined, null otherwise.
-
getGlobalVariable
Get the value of a global variable whose slot number is known- Parameters:
slot
- the slot number of the required variable- Returns:
- the Value of the variable if defined, null otherwise.
-
getGlobalVariables
Get all the global variables, as an array. This is provided for use by debuggers. The meaning of the result can be determined by use of data held in the corresponding PackageData.- Returns:
- the array of global variables.
-