Package net.sf.saxon.instruct
Class Bindery
java.lang.Object
net.sf.saxon.instruct.Bindery
The Bindery class holds information about variables and their values. From Saxon 8.1, it is
used only for global variables: local variables are now held in the XPathContext object.
Variables are identified by a Binding object. Values will always be of class Value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Define how many slots are needed for global variablesvoid
assignGlobalVariable
(GlobalVariable binding, ValueRepresentation value) Assign a new value to a global variable.void
Define global parametersvoid
defineGlobalVariable
(GlobalVariable binding, ValueRepresentation value) Provide a value for a global variablegetGlobalVariable
(int slot) Get the value of a global variable whose slot number is knownGet the Global Variable Map, containing the mapping of variable names (fingerprints) to slot numbers.Get all the global variables, as an array.getGlobalVariableValue
(GlobalVariable binding) Get the value of a global variablevoid
setExecuting
(GlobalVariable binding, boolean executing) Set/Unset a flag to indicate that a particular global variable is currently being evaluated.boolean
useGlobalParameter
(int fingerprint, GlobalParam binding, XPathContext context) Use global parameter.
-
Constructor Details
-
Bindery
public Bindery()
-
-
Method Details
-
allocateGlobals
Define how many slots are needed for global variables -
defineGlobalParameters
Define global parameters- Parameters:
params
- The ParameterSet passed in by the user, eg. from the command line
-
useGlobalParameter
public boolean useGlobalParameter(int fingerprint, GlobalParam binding, XPathContext context) throws XPathException Use global parameter. This is called when a global xsl:param element is processed. If a parameter of the relevant name was supplied, it is bound to the xsl:param element. Otherwise the method returns false, so the xsl:param default will be evaluated.- Parameters:
fingerprint
- The fingerprint of the parameterbinding
- The XSLParam element to bind its value to- Returns:
- true if a parameter of this name was supplied, false if not
- Throws:
XPathException
-
defineGlobalVariable
Provide a value for a global variable- Parameters:
binding
- identifies the variablevalue
- the value of the variable
-
setExecuting
Set/Unset a flag to indicate that a particular global variable is currently being evaluated.- Throws:
XPathException
- If an attempt is made to set the flag when it is already set, this means the definition of the variable is circular.
-
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.
-
assignGlobalVariable
Assign a new value to a global variable. Supports saxon:assign.- Parameters:
binding
- identifies the local or global variable or parameter
-
getGlobalVariableMap
Get the Global Variable Map, containing the mapping of variable names (fingerprints) to slot numbers. This is provided for use by debuggers. -
getGlobalVariables
Get all the global variables, as an array. This is provided for use by debuggers that know the layout of the global variables within the array.
-