=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExpressionUtils.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExpressionUtils.java 2015-04-29 11:33:31 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExpressionUtils.java 2015-04-29 11:38:15 +0000 @@ -48,6 +48,14 @@ JEXL.setSilent( false ); } + /** + * Evaluates the given expression. The given variables will be substituted + * in the expression. + * + * @param expression the expression. + * @param vars the variables, can be null. + * @return the result of the evaluation. + */ public static Object evaluate( String expression, Map vars ) { Expression exp = JEXL.createExpression( expression ); @@ -56,7 +64,15 @@ return exp.evaluate( context ); } - + + /** + * Evaluates the given expression to true or false. The given variables will + * be substituted in the expression. + * + * @param expression the expression. + * @param vars the variables, can be null. + * @return true or false. + */ public static boolean isTrue( String expression, Map vars ) { Boolean result = (Boolean) evaluate( expression, vars );