Class AbstractCustomFEELFunction<B>
- java.lang.Object
-
- org.kie.dmn.feel.runtime.functions.BaseFEELFunction
-
- org.kie.dmn.feel.runtime.functions.AbstractCustomFEELFunction<B>
-
- All Implemented Interfaces:
FEELFunction
- Direct Known Subclasses:
CompiledCustomFEELFunction,CustomFEELFunction
public abstract class AbstractCustomFEELFunction<B> extends BaseFEELFunction
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.kie.dmn.feel.runtime.FEELFunction
FEELFunction.Param
-
-
Field Summary
Fields Modifier and Type Field Description protected Bbodyprotected EvaluationContextclosureCtx
-
Constructor Summary
Constructors Constructor Description AbstractCustomFEELFunction(java.lang.String name, java.util.List<FEELFunction.Param> parameters, B body, EvaluationContext ctx)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description EvaluationContextgetEvaluationContext()java.util.List<java.util.List<FEELFunction.Param>>getParameters()Returns the parameter for each supported signature.protected abstract java.lang.ObjectinternalInvoke(EvaluationContext ctx)FEELFnResult<java.lang.Object>invoke(EvaluationContext ctx, java.lang.Object[] params)this method should be overriden by custom function implementations that should be invoked reflectivelyprotected booleanisCustomFunction()booleanisProperClosure()java.lang.StringtoString()-
Methods inherited from class org.kie.dmn.feel.runtime.functions.BaseFEELFunction
getName, getSymbol, invokeReflectively, setName
-
-
-
-
Field Detail
-
body
protected final B body
-
closureCtx
protected final EvaluationContext closureCtx
-
-
Constructor Detail
-
AbstractCustomFEELFunction
public AbstractCustomFEELFunction(java.lang.String name, java.util.List<FEELFunction.Param> parameters, B body, EvaluationContext ctx)
-
-
Method Detail
-
invoke
public FEELFnResult<java.lang.Object> invoke(EvaluationContext ctx, java.lang.Object[] params)
Description copied from class:BaseFEELFunctionthis method should be overriden by custom function implementations that should be invoked reflectively- Overrides:
invokein classBaseFEELFunction- Returns:
-
internalInvoke
protected abstract java.lang.Object internalInvoke(EvaluationContext ctx)
-
getParameters
public java.util.List<java.util.List<FEELFunction.Param>> getParameters()
Description copied from interface:FEELFunctionReturns the parameter for each supported signature.- Specified by:
getParametersin interfaceFEELFunction- Overrides:
getParametersin classBaseFEELFunction- Returns:
- a List of Lists of Strings with the parameters. For a function with multiple signatures, each element of the list returns the parameters of one signature. E.g.: the substring function has 2 supported signatures: substring( string, start position ) substring( string, start position, length ) So this method will return: { { "string", "start position" }, { "string", "start position", "length" } }
-
isCustomFunction
protected boolean isCustomFunction()
- Overrides:
isCustomFunctionin classBaseFEELFunction
-
isProperClosure
public boolean isProperClosure()
-
getEvaluationContext
public EvaluationContext getEvaluationContext()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-