Package dev.cel.runtime
Interface CelRuntime.Program
-
- All Superinterfaces:
Program
- Enclosing interface:
- CelRuntime
@Immutable public static interface CelRuntime.Program extends Program
Creates an evaluablePrograminstance which is thread-safe and immutable.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectadvanceEvaluation(UnknownContext context)Advance evaluation based on the current unknown context.java.lang.Objecteval(com.google.protobuf.Message message)Evaluate the expression usingmessagefields as the source of input variables.java.lang.Objecttrace(com.google.protobuf.Message message, CelEvaluationListener listener)Trace evaluates a compiled program usingmessagefields as the source of input variables.java.lang.Objecttrace(CelEvaluationListener listener)Trace evaluates a compiled program without any variables and invokes the listener as evaluation progresses through the AST.java.lang.Objecttrace(CelVariableResolver resolver, CelEvaluationListener listener)Trace evaluates a compiled program using a custom variableresolver.java.lang.Objecttrace(CelVariableResolver resolver, CelFunctionResolver lateBoundFunctionResolver, CelEvaluationListener listener)Trace evaluates a compiled program using a custom variableresolverand late-bound functionslateBoundFunctionResolver.java.lang.Objecttrace(PartialVars partialVars, CelEvaluationListener listener)Trace evaluates a compiled program usingpartialVarsas the source of input variables and unknown attribute patterns.java.lang.Objecttrace(java.util.Map<java.lang.String,?> mapValue, CelEvaluationListener listener)Trace evaluates a compiled program using amapValueas the source of input variables.java.lang.Objecttrace(java.util.Map<java.lang.String,?> mapValue, CelFunctionResolver lateBoundFunctionResolver, CelEvaluationListener listener)Trace evaluates a compiled program using amapValueas the source of input variables and late-bound functionslateBoundFunctionResolver.
-
-
-
Method Detail
-
eval
java.lang.Object eval(com.google.protobuf.Message message) throws CelEvaluationExceptionEvaluate the expression usingmessagefields as the source of input variables.- Throws:
CelEvaluationException
-
trace
java.lang.Object trace(CelEvaluationListener listener) throws CelEvaluationException
Trace evaluates a compiled program without any variables and invokes the listener as evaluation progresses through the AST.- Throws:
CelEvaluationException
-
trace
java.lang.Object trace(java.util.Map<java.lang.String,?> mapValue, CelEvaluationListener listener) throws CelEvaluationExceptionTrace evaluates a compiled program using amapValueas the source of input variables. The listener is invoked as evaluation progresses through the AST.- Throws:
CelEvaluationException
-
trace
java.lang.Object trace(com.google.protobuf.Message message, CelEvaluationListener listener) throws CelEvaluationExceptionTrace evaluates a compiled program usingmessagefields as the source of input variables. The listener is invoked as evaluation progresses through the AST.- Throws:
CelEvaluationException
-
trace
java.lang.Object trace(CelVariableResolver resolver, CelEvaluationListener listener) throws CelEvaluationException
Trace evaluates a compiled program using a custom variableresolver. The listener is invoked as evaluation progresses through the AST.- Throws:
CelEvaluationException
-
trace
java.lang.Object trace(CelVariableResolver resolver, CelFunctionResolver lateBoundFunctionResolver, CelEvaluationListener listener) throws CelEvaluationException
Trace evaluates a compiled program using a custom variableresolverand late-bound functionslateBoundFunctionResolver. The listener is invoked as evaluation progresses through the AST.- Throws:
CelEvaluationException
-
trace
java.lang.Object trace(java.util.Map<java.lang.String,?> mapValue, CelFunctionResolver lateBoundFunctionResolver, CelEvaluationListener listener) throws CelEvaluationExceptionTrace evaluates a compiled program using amapValueas the source of input variables and late-bound functionslateBoundFunctionResolver. The listener is invoked as evaluation progresses through the AST.- Throws:
CelEvaluationException
-
trace
java.lang.Object trace(PartialVars partialVars, CelEvaluationListener listener) throws CelEvaluationException
Trace evaluates a compiled program usingpartialVarsas the source of input variables and unknown attribute patterns. The listener is invoked as evaluation progresses through the AST.- Throws:
CelEvaluationException
-
advanceEvaluation
java.lang.Object advanceEvaluation(UnknownContext context) throws CelEvaluationException
Advance evaluation based on the current unknown context.This represents one round of incremental evaluation and may return a final result or a CelUnknownSet.
If no unknowns are declared in the context or
UnknownTrackingis disabled, this is equivalent to eval.- Throws:
CelEvaluationException
-
-