Package org.kie.dmn.feel.lang.impl
Class FEELImpl
- java.lang.Object
-
- org.kie.dmn.feel.lang.impl.FEELImpl
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(org.kie.dmn.api.feel.runtime.events.FEELEventListener listener)Registers a new event listener into this FEEL instance.org.kie.dmn.feel.lang.CompiledExpressioncompile(String expression, org.kie.dmn.feel.lang.CompilerContext ctx)Compiles the string expression using the given compiler context.org.kie.dmn.feel.lang.CompiledExpressioncompileUnaryTests(String expression, org.kie.dmn.feel.lang.CompilerContext ctx)Compiles the string expression using the given compiler context.Objectevaluate(String expression)Evaluates the given FEEL expression and returns the resultObjectevaluate(String expression, Map<String,Object> inputVariables)Evaluates the given FEEL expression using the given input variables, and returns the resultObjectevaluate(String expression, org.kie.dmn.feel.lang.EvaluationContext ctx)Evaluates the given FEEL expression using the given EvaluationContext, and returns the resultObjectevaluate(org.kie.dmn.feel.lang.CompiledExpression expr, Map<String,Object> inputVariables)Evaluates the given compiled FEEL expression using the given input variables, and returns the resultObjectevaluate(org.kie.dmn.feel.lang.CompiledExpression expr, org.kie.dmn.feel.lang.EvaluationContext ctx)Evaluates the given compiled FEEL expression using the given EvaluationContext, and returns the resultList<org.kie.dmn.feel.runtime.UnaryTest>evaluateUnaryTests(String expression)Evaluates the given expression as a list of of unary tests.List<org.kie.dmn.feel.runtime.UnaryTest>evaluateUnaryTests(String expression, Map<String,org.kie.dmn.feel.lang.Type> variableTypes)Evaluates the given expression as a list of of unary tests.org.kie.dmn.feel.lang.impl.FEELEventListenersManagergetEventsManager(Collection<org.kie.dmn.api.feel.runtime.events.FEELEventListener> contextListeners)Set<org.kie.dmn.api.feel.runtime.events.FEELEventListener>getListeners()Retrieves the set of registered event listenersorg.kie.dmn.feel.lang.CompilerContextnewCompilerContext()Factory method to create a new compiler contextorg.kie.dmn.feel.lang.CompilerContextnewCompilerContext(Collection<org.kie.dmn.api.feel.runtime.events.FEELEventListener> contextListeners)org.kie.dmn.feel.lang.EvaluationContextnewEvaluationContext(Collection<org.kie.dmn.api.feel.runtime.events.FEELEventListener> listeners, Map<String,Object> inputVariables)StringparseTest(String value)voidremoveListener(org.kie.dmn.api.feel.runtime.events.FEELEventListener listener)Removes a listener from the list of event listeners.
-
-
-
Constructor Detail
-
FEELImpl
public FEELImpl()
-
FEELImpl
public FEELImpl(List<org.kie.dmn.feel.lang.FEELProfile> profiles)
-
-
Method Detail
-
newCompilerContext
public org.kie.dmn.feel.lang.CompilerContext newCompilerContext()
Description copied from interface:FEELFactory method to create a new compiler context- Specified by:
newCompilerContextin interfaceFEEL- Returns:
- compiler context with default options set
-
newCompilerContext
public org.kie.dmn.feel.lang.CompilerContext newCompilerContext(Collection<org.kie.dmn.api.feel.runtime.events.FEELEventListener> contextListeners)
-
compile
public org.kie.dmn.feel.lang.CompiledExpression compile(String expression, org.kie.dmn.feel.lang.CompilerContext ctx)
Description copied from interface:FEELCompiles the string expression using the given compiler context.
-
compileUnaryTests
public org.kie.dmn.feel.lang.CompiledExpression compileUnaryTests(String expression, org.kie.dmn.feel.lang.CompilerContext ctx)
Description copied from interface:FEELCompiles the string expression using the given compiler context.- Specified by:
compileUnaryTestsin interfaceFEEL- Parameters:
expression- a FEEL expression for unary testsctx- a compiler context- Returns:
- the compiled unary tests
-
evaluate
public Object evaluate(String expression)
Description copied from interface:FEELEvaluates the given FEEL expression and returns the result
-
evaluate
public Object evaluate(String expression, org.kie.dmn.feel.lang.EvaluationContext ctx)
Description copied from interface:FEELEvaluates the given FEEL expression using the given EvaluationContext, and returns the result
-
evaluate
public Object evaluate(String expression, Map<String,Object> inputVariables)
Description copied from interface:FEELEvaluates the given FEEL expression using the given input variables, and returns the result- Specified by:
evaluatein interfaceFEEL- Parameters:
expression- a FEEL expressioninputVariables- a map of input Variables. The keys on the map are the variable names, that need to follow the naming rules for the FEEL language. The values on the map are the corresponding values for the variables. It is completely fine to use a previously returned FEEL context as inputVariables.- Returns:
- the result of the evaluation of the expression.
-
evaluate
public Object evaluate(org.kie.dmn.feel.lang.CompiledExpression expr, Map<String,Object> inputVariables)
Description copied from interface:FEELEvaluates the given compiled FEEL expression using the given input variables, and returns the result- Specified by:
evaluatein interfaceFEEL- Parameters:
expr- a FEEL expressioninputVariables- a map of input Variables. The keys on the map are the variable names, that need to follow the naming rules for the FEEL language. The values on the map are the corresponding values for the variables. It is completely fine to use a previously returned FEEL context as inputVariables.- Returns:
- the result of the evaluation of the expression.
-
evaluate
public Object evaluate(org.kie.dmn.feel.lang.CompiledExpression expr, org.kie.dmn.feel.lang.EvaluationContext ctx)
Description copied from interface:FEELEvaluates the given compiled FEEL expression using the given EvaluationContext, and returns the result
-
newEvaluationContext
public org.kie.dmn.feel.lang.EvaluationContext newEvaluationContext(Collection<org.kie.dmn.api.feel.runtime.events.FEELEventListener> listeners, Map<String,Object> inputVariables)
-
evaluateUnaryTests
public List<org.kie.dmn.feel.runtime.UnaryTest> evaluateUnaryTests(String expression)
Description copied from interface:FEELEvaluates the given expression as a list of of unary tests. The syntax for this is defined in the FEEL grammar rule #17, i.e., a list of unary tests separated by commas.- Specified by:
evaluateUnaryTestsin interfaceFEEL- Parameters:
expression- a unary test list expression- Returns:
- a List of compiled UnaryTests
-
evaluateUnaryTests
public List<org.kie.dmn.feel.runtime.UnaryTest> evaluateUnaryTests(String expression, Map<String,org.kie.dmn.feel.lang.Type> variableTypes)
Description copied from interface:FEELEvaluates the given expression as a list of of unary tests. The syntax for this is defined in the FEEL grammar rule #17, i.e., a list of unary tests separated by commas.- Specified by:
evaluateUnaryTestsin interfaceFEEL- Parameters:
expression- a unary test list expressionvariableTypes- map of variable names and corresponding types, necessary to compile the unary tests- Returns:
- a List of compiled UnaryTests
-
addListener
public void addListener(org.kie.dmn.api.feel.runtime.events.FEELEventListener listener)
Description copied from interface:FEELRegisters a new event listener into this FEEL instance. The event listeners are notified about signitificative events during compilation or evaluation of expressions.- Specified by:
addListenerin interfaceFEEL- Parameters:
listener- the listener to register
-
removeListener
public void removeListener(org.kie.dmn.api.feel.runtime.events.FEELEventListener listener)
Description copied from interface:FEELRemoves a listener from the list of event listeners.- Specified by:
removeListenerin interfaceFEEL- Parameters:
listener- the listener to remove
-
getListeners
public Set<org.kie.dmn.api.feel.runtime.events.FEELEventListener> getListeners()
Description copied from interface:FEELRetrieves the set of registered event listeners- Specified by:
getListenersin interfaceFEEL- Returns:
- the set of listeners
-
getEventsManager
public org.kie.dmn.feel.lang.impl.FEELEventListenersManager getEventsManager(Collection<org.kie.dmn.api.feel.runtime.events.FEELEventListener> contextListeners)
-
-