public class StackContext
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected SimulatedStack<java.lang.Object> |
stack
The stack contained in this object.
|
Constructor and Description |
---|
StackContext() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
evaluate(java.lang.String string)
Parse and evaluate the given Stoex using the current stackframe on top of the stack
|
<T> T |
evaluate(java.lang.String string,
java.lang.Class<T> expectedType)
Parse and evaluate the given Stoex
|
java.lang.Object |
evaluate(java.lang.String stoex,
SimulatedStackframe<java.lang.Object> currentFrame)
Parse and evaluate the given Stoex
|
void |
evaluateInner(SimulatedStackframe<java.lang.Object> frame,
java.lang.String variablename)
Evaluate all EvaluationProxies starting with "variable name" and store the results in the
given stack frame
|
static java.lang.Object |
evaluateStatic(java.lang.String stoex)
Parse and evaluate the given Stoex
|
static <T> T |
evaluateStatic(java.lang.String string,
java.lang.Class<T> expectedType)
Parse and evaluate the given Stoex
|
static <T> T |
evaluateStatic(java.lang.String string,
java.lang.Class<T> expectedType,
SimulatedStackframe<java.lang.Object> frame)
Parse and evaluate the given Stoex
|
static <T> T |
evaluateStatic(java.lang.String string,
java.lang.Class<T> expectedType,
SimulatedStackframe<java.lang.Object> frame,
VariableMode mode)
Parse and evaluate the given Stoex
|
static java.lang.Object |
evaluateStatic(java.lang.String stoex,
SimulatedStackframe<java.lang.Object> currentFrame)
Parse and evaluate the given Stoex
|
static java.lang.Object |
evaluateStatic(java.lang.String stoex,
SimulatedStackframe<java.lang.Object> currentFrame,
VariableMode mode)
Parse and evaluate the given Stoex
|
VariableMode |
getEvaluationMode() |
SimulatedStack<java.lang.Object> |
getStack() |
void |
setEvaluationMode(VariableMode mode)
Set the evaluation method
|
protected SimulatedStack<java.lang.Object> stack
public <T> T evaluate(java.lang.String string, java.lang.Class<T> expectedType)
string
- Stoex to evaluateexpectedType
- Type expected by the evaluation. It tries to case the type when needed. If the
type cannot be case, an evaluation exception is thrownpublic java.lang.Object evaluate(java.lang.String string)
string
- Stoex to evaluatepublic java.lang.Object evaluate(java.lang.String stoex, SimulatedStackframe<java.lang.Object> currentFrame)
string
- Stoex to evaluatecurrentFrame
- The Stackframe under which the evaluation is performedpublic static java.lang.Object evaluateStatic(java.lang.String stoex)
string
- Stoex to evaluatepublic static java.lang.Object evaluateStatic(java.lang.String stoex, SimulatedStackframe<java.lang.Object> currentFrame)
string
- Stoex to evaluatecurrentFrame
- The Stackframe under which the evaluation is performedpublic static java.lang.Object evaluateStatic(java.lang.String stoex, SimulatedStackframe<java.lang.Object> currentFrame, VariableMode mode)
string
- Stoex to evaluatecurrentFrame
- The Stackframe under which the evaluation is performedmode
- Evaluation mode to usepublic static <T> T evaluateStatic(java.lang.String string, java.lang.Class<T> expectedType)
string
- Stoex to evaluateexpectedType
- Type expected by the evaluation. It tries to case the type when needed. If the
type cannot be case, an evaluation exception is thrownpublic static <T> T evaluateStatic(java.lang.String string, java.lang.Class<T> expectedType, SimulatedStackframe<java.lang.Object> frame)
string
- Stoex to evaluateexpectedType
- Type expected by the evaluation. It tries to case the type when needed. If the
type cannot be case, an evaluation exception is thrownframe
- Stackframe to be used in the evaluationpublic static <T> T evaluateStatic(java.lang.String string, java.lang.Class<T> expectedType, SimulatedStackframe<java.lang.Object> frame, VariableMode mode)
string
- Stoex to evaluateexpectedType
- Type expected by the evaluation. It tries to case the type when needed. If the
type cannot be case, an evaluation exception is thrownframe
- Stackframe to be used in the evaluationmode
- Evaluation mode to usepublic void evaluateInner(SimulatedStackframe<java.lang.Object> frame, java.lang.String variablename)
frame
- The frame which stores the evaluated proxy resultsvariablename
- public SimulatedStack<java.lang.Object> getStack()
public VariableMode getEvaluationMode()
public void setEvaluationMode(VariableMode mode)
mode
- The new evaluation method to set