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
.
Constructor and Description |
---|
Bindery(PackageData pack) |
Modifier and Type | Method and Description |
---|---|
Sequence |
getGlobalVariable(int slot)
Get the value of a global variable whose slot number is known
|
Sequence[] |
getGlobalVariables()
Get all the global variables, as an array.
|
Sequence |
getGlobalVariableValue(GlobalVariable binding)
Get the value of a global variable
|
Sequence |
saveGlobalVariableValue(GlobalVariable binding,
Sequence 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,
Sequence 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, Sequence 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 Sequence saveGlobalVariableValue(GlobalVariable binding, Sequence value)
binding
- the global variable in questionvalue
- the value that this thread has obtained by evaluating the variablepublic Sequence getGlobalVariableValue(GlobalVariable binding)
binding
- the Binding that establishes the unique instance of the variablepublic Sequence getGlobalVariable(int slot)
slot
- the slot number of the required variablepublic Sequence[] getGlobalVariables()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.