org.sintef.mofscript.runtime.expression
Class ExpressionEvaluator

java.lang.Object
  extended by org.sintef.mofscript.runtime.expression.ExpressionEvaluator
Direct Known Subclasses:
ArithmeticExpressionEvaluator, ComparisonExpressionEvaluator, LogicalExpressionEvaluator, NullEvaluator, SimpleExpressionEvaluator

public abstract class ExpressionEvaluator
extends java.lang.Object


Field Summary
protected  ExecutionEnvironment _env
           
protected  Expression _expression
           
protected  RuleExecutor _ownerRuleExecutor
           
protected static int _positionCounter
           
 
Constructor Summary
ExpressionEvaluator(Expression expression, ExecutionEnvironment env, RuleExecutor ownerRuleExecutor)
           
 
Method Summary
protected abstract  java.lang.Object evaluate(java.lang.Object inputObject)
          To be defined by subclasses - the actual evaluation of the expression
 java.lang.Object evaluateExpression(java.lang.Object inputObject)
          Evaluates an expression and returns the value as an Object
static void resetPosisionCounter()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_expression

protected Expression _expression

_env

protected ExecutionEnvironment _env

_ownerRuleExecutor

protected RuleExecutor _ownerRuleExecutor

_positionCounter

protected static int _positionCounter
Constructor Detail

ExpressionEvaluator

public ExpressionEvaluator(Expression expression,
                           ExecutionEnvironment env,
                           RuleExecutor ownerRuleExecutor)
Method Detail

evaluateExpression

public final java.lang.Object evaluateExpression(java.lang.Object inputObject)
                                          throws MofScriptExecutionException
Evaluates an expression and returns the value as an Object

Parameters:
exp -
Returns:
Throws:
MofScriptExecutionException

resetPosisionCounter

public static void resetPosisionCounter()

evaluate

protected abstract java.lang.Object evaluate(java.lang.Object inputObject)
                                      throws MofScriptExecutionException
To be defined by subclasses - the actual evaluation of the expression

Returns:
Throws:
MofScriptExecutionException