public final class Bindery
extends java.lang.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
.
Modifier and Type | Class and Description |
---|---|
static class |
Bindery.FailureValue
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 and Description |
---|
Bindery(PackageData pack) |
Modifier and Type | Method and Description |
---|---|
GroundedValue<?> |
getGlobalVariable(int slot)
Get the value of a global variable whose slot number is known
|
GroundedValue[] |
getGlobalVariables()
Get all the global variables, as an array.
|
GroundedValue<?> |
getGlobalVariableValue(GlobalVariable binding)
Get the value of a global variable
|
GroundedValue<?> |
saveGlobalVariableValue(GlobalVariable binding,
GroundedValue<?> value)
Save the value of a global variable, and mark evaluation as complete.
|
boolean |
setExecuting(GlobalVariable binding)
Set/Unset a flag to indicate that a particular global variable is currently being
evaluated.
|
void |
setGlobalVariable(GlobalVariable binding,
GroundedValue<?> value)
Provide a value for a global variable
|
void |
setNotExecuting(GlobalVariable binding)
Indicate that a global variable is not currently being evaluated
|
public Bindery(PackageData pack)
public void setGlobalVariable(GlobalVariable binding, GroundedValue<?> value)
binding
- identifies the variablevalue
- the value of the variablepublic boolean setExecuting(GlobalVariable binding) throws XPathException
binding
- the global variable in questionXPathException
- If an attempt is made to set the flag when it is already set, this means
the definition of the variable is circular.public void setNotExecuting(GlobalVariable binding)
binding
- the global variablepublic GroundedValue<?> saveGlobalVariableValue(GlobalVariable binding, GroundedValue<?> value)
binding
- the global variable in questionvalue
- the value that this thread has obtained by evaluating the variablepublic GroundedValue<?> getGlobalVariableValue(GlobalVariable binding)
binding
- the Binding that establishes the unique instance of the variablepublic GroundedValue<?> getGlobalVariable(int slot)
slot
- the slot number of the required variablepublic GroundedValue[] getGlobalVariables()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.