Class Bindery
java.lang.Object
com.icl.saxon.Bindery
The Bindery class holds information about variables and their values.
Variables are identified by a Binding object. Values can be any object, though values of XSL
variables will always be of class Value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidallocateGlobals(int n) Define how many slots are needed for global variablesvoidallocateLocals(int n) Define how many slots are needed for local variables.voidassignVariable(Binding binding, Value value) Assign a new value to a variablevoidClose the current stack frame for local variablesvoiddefineGlobalParameters(ParameterSet params) Define global parametersvoiddefineGlobalVariable(Binding binding, Value value) Define global variablevoiddefineLocalVariable(Binding binding, Value value) Define local variableintGet the id of the current frame.getLocalParameter(int fingerprint) Get local parameter.Get the value of a variableGet the value of a variable in the given framebooleanisEvaluated(Binding binding) Test if global variable has already been evaluatedvoidopenStackFrame(ParameterSet localParameters) Start a new stack frame for local variablesvoidsetExecuting(Binding binding, boolean executing) Set/Unset a flag to indicate that a particular global variable is currently being evaluated.booleanuseGlobalParameter(int fingerprint, Binding binding) Use global parameter.booleanuseLocalParameter(int fingerprint, Binding binding) Use local parameter.
-
Constructor Details
-
Bindery
public Bindery()
-
-
Method Details
-
allocateGlobals
public void allocateGlobals(int n) 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
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
-
defineGlobalVariable
-
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.
-
isEvaluated
Test if global variable has already been evaluated -
allocateLocals
public void allocateLocals(int n) Define how many slots are needed for local variables. We work on the basis of "one size fits all": all stackframes are allocated as large as the largest one needed -
openStackFrame
Start a new stack frame for local variables -
closeStackFrame
public void closeStackFrame()Close the current stack frame for local variables -
useLocalParameter
Use local parameter. This is called when a local 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 parameter namebinding- The XSLParam element to bind its value to- Returns:
- true if a parameter of this name was supplied, false if not
-
getLocalParameter
Get local parameter. This method is available to user-written node handlers invoked via the saxon:handler interface, it allows them to retrieve the values of parameters set up within a calling XSL template.- Returns:
- The value of the parameter, or null if not supplied
-
defineLocalVariable
-
getValue
-
getValue
-
getFrameId
public int getFrameId()Get the id of the current frame.- Returns:
- an id, that may be given to getValue(Binding,int)
-
assignVariable
-