|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.instruct.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.
Field Summary | |
static int |
FRAME_PARAMS
|
static int |
FRAME_TUNNEL_PARAMS
|
static int |
FRAME_VARIABLES
|
Constructor Summary | |
Bindery()
|
Method Summary | |
void |
allocateGlobals(int n)
Define how many slots are needed for global variables |
void |
allocateLocals(int n)
Define how many slots are needed for local variables. |
void |
assignVariable(DefiningVariable binding,
Value value)
Assign a new value to a variable |
void |
closeStackFrame()
Close the current stack frame for local variables |
void |
defineGlobalParameters(ParameterSet params)
Define global parameters |
void |
defineGlobalVariable(DefiningVariable binding,
Value value)
Provide a value for a global variable |
Value |
evaluateGlobalVariable(DefiningVariable binding)
Get the value of a global variable |
Object[] |
getCurrentStackFrame()
Get a reference to the current stackframe containing local variables. |
int |
getFrameId()
Get the id of the current frame. |
Value |
getLocalVariable(int slotNumber)
Get the value of a local variable, given its slot number |
ParameterSet |
getTunnelParameters()
Get the set of tunnel parameters from the local stackframe |
Value |
getValue(DefiningVariable binding,
int frameId)
Get the value of a variable in the given frame |
boolean |
isEvaluated(DefiningVariable binding)
Test if global variable has already been evaluated |
void |
openStackFrame()
Start a new stack frame without parameters |
void |
openStackFrame(ParameterSet localParameters,
ParameterSet tunnelParameters)
Start a new stack frame supplying parameters by name |
void |
openStackFrame(Value[] arguments)
Start a new stack frame supplying parameters positionally |
void |
setExecuting(DefiningVariable binding,
boolean executing)
Set/Unset a flag to indicate that a particular global variable is currently being evaluated. |
void |
setLocalVariable(int slotNumber,
Value value)
Set the value of a local variable. |
boolean |
useGlobalParameter(int fingerprint,
DefiningVariable binding)
Use global parameter. |
boolean |
useLocalParameter(int fingerprint,
DefiningVariable binding,
boolean isTunnel)
Use local parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FRAME_PARAMS
public static final int FRAME_TUNNEL_PARAMS
public static final int FRAME_VARIABLES
Constructor Detail |
public Bindery()
Method Detail |
public void allocateGlobals(int n)
public void defineGlobalParameters(ParameterSet params)
params
- The ParameterSet passed in by the user, eg. from the command linepublic boolean useGlobalParameter(int fingerprint, DefiningVariable binding) throws XPathException
fingerprint
- The fingerprint of the parameterbinding
- The XSLParam element to bind its value to
XPathException
public void defineGlobalVariable(DefiningVariable binding, Value value)
binding
- identifies the variablevalue
- the value of the variablepublic void setExecuting(DefiningVariable binding, boolean executing) throws XPathException
XPathException
- If an attempt is made to set the flag when it is already set, this means
the definition of the variable is circular.public boolean isEvaluated(DefiningVariable binding)
public void allocateLocals(int n)
public void openStackFrame(ParameterSet localParameters, ParameterSet tunnelParameters)
public void openStackFrame()
public void openStackFrame(Value[] arguments)
public void closeStackFrame()
public boolean useLocalParameter(int fingerprint, DefiningVariable binding, boolean isTunnel) throws XPathException
fingerprint
- The fingerprint of the parameter namebinding
- The XSLParam element to bind its value toisTunnel
- True if a tunnel parameter is required, else false
XPathException
public void setLocalVariable(int slotNumber, Value value)
slotNumber
- identifies the variablevalue
- the value of the variablepublic Value evaluateGlobalVariable(DefiningVariable binding)
binding
- the Binding that establishes the unique instance of the variable
public Value getLocalVariable(int slotNumber)
slotNumber
- identifies the local variable
public Object[] getCurrentStackFrame()
public ParameterSet getTunnelParameters()
public Value getValue(DefiningVariable binding, int frameId)
binding
- the Binding that establishes the unique instance of the variableframeId
- the id of the frame, see getFrameId
public int getFrameId()
public void assignVariable(DefiningVariable binding, Value value)
binding
- identifies the local or global variable or parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |