Class GroovyFormulaEvaluator
- java.lang.Object
-
- org.faktorips.runtime.formula.AbstractFormulaEvaluator
-
- org.faktorips.runtime.formula.groovy.GroovyFormulaEvaluator
-
- All Implemented Interfaces:
org.faktorips.runtime.formula.IFormulaEvaluator
public class GroovyFormulaEvaluator extends org.faktorips.runtime.formula.AbstractFormulaEvaluatorThis formula evaluator evaluates the formulas using groovy. The implementation expects the formula compiled as java code. Each compiled expression should be a complete java method including the method signature. It expects the product component or product component generation in which context the method should run. These are referenced as 'this' within the method. That means the method is expected to run within the context of the product component or product component generation.- Author:
- dirmeier
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTHIS_CLASS_VAR
-
Constructor Summary
Constructors Constructor Description GroovyFormulaEvaluator(java.lang.Object object, java.util.Map<java.lang.String,java.lang.String> nameToExpressionMap)The constructor expects the product component or product component generation and a list of java method, one for every formula that should be evaluated by this formula evaluator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectevaluateInternal(java.lang.String formularName, java.lang.Object... parameters)
-
-
-
Field Detail
-
THIS_CLASS_VAR
public static final java.lang.String THIS_CLASS_VAR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GroovyFormulaEvaluator
public GroovyFormulaEvaluator(java.lang.Object object, java.util.Map<java.lang.String,java.lang.String> nameToExpressionMap)The constructor expects the product component or product component generation and a list of java method, one for every formula that should be evaluated by this formula evaluator. The methods should be designed to run in the context of the product component generation. The product component generation should be referenced as 'this' within the methods body.- Parameters:
object- the product component or product component generation in which context the compiled expression methods would runnameToExpressionMap- a list of compiled expression methods, one for each formula
-
-