Package org.openbravo.base.expression
Class Evaluator
- java.lang.Object
-
- org.openbravo.base.expression.Evaluator
-
- All Implemented Interfaces:
OBProvidable
,OBSingleton
public class Evaluator extends Object implements OBSingleton
Evaluates expressions in the context of a business object, the expression language supported by this class is javascript rhino.- Author:
- mtaal
-
-
Constructor Summary
Constructors Constructor Description Evaluator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
evaluateBoolean(BaseOBObjectDef contextBob, String script)
Evaluates the passed script in the context of the passed business object.static Evaluator
getInstance()
static void
setInstance(Evaluator instance)
-
-
-
Method Detail
-
getInstance
public static Evaluator getInstance()
-
setInstance
public static void setInstance(Evaluator instance)
-
evaluateBoolean
public Boolean evaluateBoolean(BaseOBObjectDef contextBob, String script)
Evaluates the passed script in the context of the passed business object. This means that properties of the business object may be used directly in the script. The result should always be a boolean.- Parameters:
contextBob
- the script is executed in the context of this business objectscript
- the javascript which much evaluate to a boolean- Returns:
- the result of the script evaluation
-
-