net.sf.oval.expression
Class ExpressionLanguageJavaScriptImpl

java.lang.Object
  extended by net.sf.oval.expression.ExpressionLanguageJavaScriptImpl
All Implemented Interfaces:
ExpressionLanguage

public class ExpressionLanguageJavaScriptImpl
extends Object
implements ExpressionLanguage

Author:
Sebastian Thomschke

Constructor Summary
ExpressionLanguageJavaScriptImpl()
          Default constructor.
 
Method Summary
 Object evaluate(String expression, Map<String,?> values)
          Evaluates the given expression.
 boolean evaluateAsBoolean(String expression, Map<String,?> values)
          Evaluates the given expression and expects it to return a boolean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionLanguageJavaScriptImpl

public ExpressionLanguageJavaScriptImpl()
Default constructor.

Method Detail

evaluate

public Object evaluate(String expression,
                       Map<String,?> values)
                throws ExpressionEvaluationException
Evaluates the given expression.

Specified by:
evaluate in interface ExpressionLanguage
Parameters:
expression - the expression to evaluate
values - context values passed to the interpreter
Returns:
the result of the expression evaluation
Throws:
ExpressionEvaluationException - in case of an invalid expression

evaluateAsBoolean

public boolean evaluateAsBoolean(String expression,
                                 Map<String,?> values)
                          throws ExpressionEvaluationException
Evaluates the given expression and expects it to return a boolean.

Specified by:
evaluateAsBoolean in interface ExpressionLanguage
Parameters:
expression - the expression to evaluate
values - context values passed to the interpreter
Returns:
the result of the expression evaluation
Throws:
ExpressionEvaluationException - If an error during evaluation occurs or if the return value is not a boolean value.


Copyright © 2005-2013 The OVal Development Team. All Rights Reserved.