net.sf.oval.expression
Class AbstractExpressionLanguage

java.lang.Object
  extended by net.sf.oval.expression.AbstractExpressionLanguage
All Implemented Interfaces:
ExpressionLanguage
Direct Known Subclasses:
ExpressionLanguageBeanShellImpl, ExpressionLanguageGroovyImpl, ExpressionLanguageJavaScriptImpl, ExpressionLanguageJEXLImpl, ExpressionLanguageJRubyImpl, ExpressionLanguageMVELImpl, ExpressionLanguageOGNLImpl, ExpressionLanguageScriptEngineImpl

public abstract class AbstractExpressionLanguage
extends Object
implements ExpressionLanguage

Author:
Sebastian Thomschke

Constructor Summary
AbstractExpressionLanguage()
           
 
Method Summary
 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
 
Methods inherited from interface net.sf.oval.expression.ExpressionLanguage
evaluate
 

Constructor Detail

AbstractExpressionLanguage

public AbstractExpressionLanguage()
Method Detail

evaluateAsBoolean

public boolean evaluateAsBoolean(String expression,
                                 Map<String,?> values)
                          throws ExpressionEvaluationException
Description copied from interface: ExpressionLanguage
Evaluates the given expression and expects it to return a boolean.
  • null is interpreted as false
  • a number with value 0 is interpreted as false
  • an empty CharSequence is interpreted as false
  • a CharSequence with value "0" is interpreted as false
  • a CharSequence with value "1" is interpreted as true
  • a CharSequence with value "false" is case-insensitively interpreted as false
  • a CharSequence with value "true" is case-insensitively interpreted as true

    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–2015 The OVal Development Team. All rights reserved.