org.pm4j.core.pm.impl.expr
Class ExprExecCtxt

java.lang.Object
  extended by org.pm4j.core.pm.impl.expr.ExprExecCtxt
Direct Known Subclasses:
PmExprExecCtxt

public class ExprExecCtxt
extends java.lang.Object

The execution context for expressions.
Holds the current value of the expression.

For exception reporting and debugging it provides a history of expression execution states.

Author:
olaf boede

Nested Class Summary
static class ExprExecCtxt.HistoryItem
          An executed expression and it's result.
 
Constructor Summary
ExprExecCtxt(java.lang.Object startObject)
           
 
Method Summary
 Expression getCurrentExpr()
           
 java.lang.Object getCurrentValue()
           
 java.util.List<ExprExecCtxt.HistoryItem> getExecHistory()
           
 Expression getStartExpr()
           
 java.lang.Object getStartValue()
           
 ExprExecCtxt makeSubCtxt()
          Generates a sub context that may be used to evaluate a separate expression.
 void setCurrentExpr(Expression expr)
           
 void setCurrentValue(Expression expr, java.lang.Object newObject)
          Gets called whenever an expression has calculated a new value state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExprExecCtxt

public ExprExecCtxt(java.lang.Object startObject)
Parameters:
startObject - The value to start the expression evaluation with.
Method Detail

setCurrentExpr

public void setCurrentExpr(Expression expr)

getCurrentValue

public java.lang.Object getCurrentValue()
Returns:
The result of the last expression execution.

setCurrentValue

public void setCurrentValue(Expression expr,
                            java.lang.Object newObject)
Gets called whenever an expression has calculated a new value state.

Parameters:
expr - The just processed expression.
newObject - The result of the expression.

getStartValue

public java.lang.Object getStartValue()
Returns:
The value, expression evaluation was started with.

getExecHistory

public java.util.List<ExprExecCtxt.HistoryItem> getExecHistory()
Returns:
The expression execution history.

getStartExpr

public Expression getStartExpr()

getCurrentExpr

public Expression getCurrentExpr()

makeSubCtxt

public ExprExecCtxt makeSubCtxt()
Generates a sub context that may be used to evaluate a separate expression. For example an expression that evaluates a method call parameter value.

Returns:
A separate subcontext instance.