|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.expression.ExState
com.waveset.object.FormState
A class encapsulating the runtime state associated with Form evaluation.
This extends the ExState object so it can serve as an XPRESS state holder. It also contains the form inputs and outputs, and various evaluation options.
Nested Class Summary | |
static class |
FormState.MissingRequiredField
|
Nested classes inherited from class com.waveset.expression.ExState |
ExState.ExBreakpointContext |
Field Summary | |
static java.lang.String |
code_id
|
Constructor Summary | |
FormState(Form form,
ObjectCache cache)
Build a new FormState object. |
Method Summary | |
void |
bindVariable(java.lang.String name,
java.lang.Object value)
|
void |
clearVariables()
|
protected ExState.ExBreakpointContext |
createBreakpointContext()
Override createBreakpointContext to create a FormBreakpointContext instead. |
void |
cycle(java.util.Map object)
Convenience method to do a very common derive/expand cycle on a GenericObject. |
void |
derive()
Iterate over form fields running Derivation and Default expressions. |
void |
expand()
Run form expansion. |
java.lang.String |
expandVariables(java.lang.String src)
Expand any variable references in a string. |
void |
formCycleEnd(com.sun.idm.debugger.common.FormCycle cycle)
|
com.sun.idm.debugger.common.FormCycle |
formCycleStart(com.sun.idm.debugger.common.FormCycle.Phase phase)
|
com.sun.idm.debugger.common.FormCycle |
formCycleStart(com.sun.idm.debugger.common.FormCycle.Phase phase,
int iteration)
|
Form.Field |
getField(java.lang.String name)
Look up a field object, handling inclusions. |
FieldIterator |
getFieldIterator()
|
Form |
getForm()
Get the Form, exposed only for FieldIterator. |
protected java.util.Map |
getInputs()
Get the input variable map, exposed only for FieldIterator. |
java.lang.Object |
getOutput(java.lang.String name)
Get one output value. |
java.util.Map |
getOutputs()
Return the output map. |
boolean |
isTolerateInvalid()
|
FieldIterator |
iterate()
Return an iterator for the Form.Field objects in the form. |
static void |
println(java.lang.String msg)
|
void |
reset()
Reset both inputs and outputs. |
void |
resetOutputs()
Clear the current outputs. |
Form.Field |
resolve(Form.FieldRef ref)
Resolve a field reference. |
Form |
resolve(Form.FormRef ref)
Resolve a form reference. |
java.lang.Object |
resolveCall(java.lang.String name,
java.util.List arglist)
Resolve an external function call. |
void |
resolveIncludes()
Load libraries included by the form. |
java.lang.Object |
resolveReference(java.lang.String name)
Resolve a reference from within a form expression. |
java.lang.Object |
resolveRule(java.lang.String name,
java.util.Map args)
Resolve a rule call. |
java.lang.Object |
resolveVariable(java.lang.String name)
This is the VariableResolver interface method, called during the expansion of $(var) references. |
void |
setBaseContext(java.lang.String bc)
|
void |
setContext(LighthouseContext lc)
|
void |
setExternal(java.lang.String name,
java.lang.Object value)
ExState method to assign an external variable. |
void |
setFieldIterator(FieldIterator it)
This will be called as a side effect of the construction of a FieldIterator object so we have a circular reference. |
void |
setIncludeInputs(boolean b)
Set a flag that indicates that original input values are to be included in the output values. |
void |
setIncludeUnknowns(boolean b)
Set a flag that indicates that any input values that do not correspond to Field names are to be passed through to the outputs. |
void |
setInput(java.lang.String name,
java.lang.Object value)
Set an input value. |
void |
setInputs(java.util.Map inputs)
Assign the set if form input values. |
void |
setMaxIterations(int i)
Set the maximum number of iterations we will perform during form expansion. |
void |
setNullValue(java.lang.String s)
Option to specify a special string value that is used to represent a null value. |
void |
setOutputs(java.util.Map map)
Set the output map. |
void |
setRuleExecutor(RuleExecutor re)
Set the optional rule executor. |
void |
setTolerateInvalid(boolean b)
Set a flag indicating that values that don't match their constraint list should be tolerated. |
void |
setTrace(boolean t)
Enable or disable trace. |
void |
setVariable(java.lang.String name,
java.lang.Object value)
Should only be called if you have already called bindVariable and just want to change the current value. |
void |
setView(GenericObject view)
Assign a view to be proessed by the form. |
void |
unbindVariable(java.lang.String name)
|
java.util.List |
validate()
Run form validation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
Constructor Detail |
public FormState(Form form, ObjectCache cache) throws WavesetException
Method Detail |
public void setRuleExecutor(RuleExecutor re)
public void setContext(LighthouseContext lc)
public void setNullValue(java.lang.String s)
public void setInputs(java.util.Map inputs)
public void setOutputs(java.util.Map map)
public void setView(GenericObject view)
public void resetOutputs()
public void reset()
public void setTrace(boolean t)
public void setIncludeInputs(boolean b)
public void setIncludeUnknowns(boolean b)
public void setTolerateInvalid(boolean b)
public void setMaxIterations(int i)
public void setBaseContext(java.lang.String bc)
public void clearVariables()
public void bindVariable(java.lang.String name, java.lang.Object value)
public void setVariable(java.lang.String name, java.lang.Object value)
public void unbindVariable(java.lang.String name)
public java.util.Map getOutputs()
public java.lang.Object getOutput(java.lang.String name)
public boolean isTolerateInvalid()
protected java.util.Map getInputs()
public Form getForm()
public FieldIterator iterate() throws WavesetException
WavesetException
public java.lang.String expandVariables(java.lang.String src) throws WavesetException
VariableExpander takes a VariableResolver interface, which we implement.
WavesetException
public static void println(java.lang.String msg)
public void resolveIncludes() throws WavesetException
WavesetException
public Form.Field resolve(Form.FieldRef ref) throws WavesetException
WavesetException
public Form.Field getField(java.lang.String name) throws WavesetException
WavesetException
public Form resolve(Form.FormRef ref) throws WavesetException
WavesetException
public void setInput(java.lang.String name, java.lang.Object value)
public java.util.List validate() throws WavesetException
WavesetException
public void cycle(java.util.Map object) throws WavesetException
WavesetException
public void expand() throws FormState.MissingRequiredField, WavesetException
FormState.MissingRequiredField
WavesetException
public void derive() throws WavesetException
Derivation and Default are similar, but Default will not overwrite an existing non-null value, Derivation always overwrites.
Derivation expressions are typically used to calculate abstract attributes for display that may correspond to several physical attributes, or may be a transformation on the physical attribute. In such cases, there is usually a hidden field representing the physical attribute that uses an Expansion expression to generate its value from the derived values.
WavesetException
public void setExternal(java.lang.String name, java.lang.Object value) throws WavesetException
setExternal
in class ExState
WavesetException
public java.lang.Object resolveReference(java.lang.String name) throws WavesetException
We have three scopes, iteration variables, output variables and input variables. They are consulted in that order.
// We need to keep a bitmap of Field's whose defaults // have not yet been expanded so we can expand the defaults // dynamically!!
resolveReference
in class ExState
WavesetException
public java.lang.Object resolveVariable(java.lang.String name) throws WavesetException
resolveVariable
in interface VariableResolver
resolveVariable
in class ExState
WavesetException
public java.lang.Object resolveCall(java.lang.String name, java.util.List arglist) throws WavesetException
resolveCall
in class ExState
WavesetException
public java.lang.Object resolveRule(java.lang.String name, java.util.Map args) throws WavesetException
resolveRule
in class ExState
WavesetException
public void setFieldIterator(FieldIterator it)
public FieldIterator getFieldIterator()
public com.sun.idm.debugger.common.FormCycle formCycleStart(com.sun.idm.debugger.common.FormCycle.Phase phase)
public com.sun.idm.debugger.common.FormCycle formCycleStart(com.sun.idm.debugger.common.FormCycle.Phase phase, int iteration)
public void formCycleEnd(com.sun.idm.debugger.common.FormCycle cycle)
protected ExState.ExBreakpointContext createBreakpointContext()
createBreakpointContext
in class ExState
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |