public final class Bindery extends Object
| Constructor and Description |
|---|
Bindery() |
| Modifier and Type | Method and Description |
|---|---|
void |
allocateGlobals(SlotManager map)
Define how many slots are needed for global variables
|
void |
defineGlobalParameters(GlobalParameterSet params)
Define global parameters
|
Sequence |
getGlobalVariable(int slot)
Get the value of a global variable whose slot number is known
|
SlotManager |
getGlobalVariableMap()
Get the Global Variable Map, containing the mapping of variable names (fingerprints)
to slot numbers.
|
Sequence[] |
getGlobalVariables()
Get all the global variables, as an array.
|
Sequence |
getGlobalVariableValue(GlobalVariable binding)
Get the value of a global variable
|
boolean |
isApplyFunctionConversionRulesToExternalVariables()
Ask whether the function conversion rules should be applied to supplied
parameter values.
|
void |
registerDependency(GlobalVariable one,
GlobalVariable two)
Register the dependency of one variable ("one") upon another ("two"), throwing an exception if this would establish
a cycle of dependencies.
|
Sequence |
saveGlobalVariableValue(GlobalVariable binding,
Sequence value)
Save the value of a global variable, and mark evaluation as complete.
|
void |
setApplyFunctionConversionRulesToExternalVariables(boolean convert)
Say whether the function conversion rules should be applied to supplied
parameter values.
|
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
|
boolean |
useGlobalParameter(StructuredQName qName,
int slot,
SequenceType requiredType,
XPathContext context)
Use global parameter.
|
public void allocateGlobals(SlotManager map)
map - the SlotManager that keeps track of slot allocation for global variables.public void setApplyFunctionConversionRulesToExternalVariables(boolean convert)
convert - true if function conversion rules are to be applied to supplied
values; if false, the supplied value must match the required type exactly.public boolean isApplyFunctionConversionRulesToExternalVariables()
public void defineGlobalParameters(GlobalParameterSet params)
params - The ParameterSet passed in by the user, eg. from the command linepublic boolean useGlobalParameter(StructuredQName qName, int slot, SequenceType requiredType, XPathContext context) throws XPathException
qName - The name of the parameterslot - The slot number allocated to the parameterrequiredType - The declared type of the parametercontext - the XPath dynamic evaluation contextXPathException - if a dynamic error occurs, for example if the supplied parameter value
does not match the required typepublic 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 SlotManager getGlobalVariableMap()
public Sequence[] getGlobalVariables()
public void registerDependency(GlobalVariable one, GlobalVariable two) throws XPathException
one - the first (dependent) variabletwo - the second (dependee) variableXPathException - if adding this dependency creates a cycle of dependencies among global variables.Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.