Package dev.cel.runtime
Class CelRuntime.Program
- java.lang.Object
-
- dev.cel.runtime.CelRuntime.Program
-
- Enclosing interface:
- CelRuntime
@Immutable public abstract static class CelRuntime.Program extends java.lang.ObjectCreates an evaluablePrograminstance which is thread-safe and immutable.
-
-
Constructor Summary
Constructors Constructor Description Program()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectadvanceEvaluation(UnknownContext context)Advance evaluation based on the current unknown context.java.lang.Objecteval()Evaluate the expression without any variables.java.lang.Objecteval(Message message)Evaluate the expression usingmessagefields as the source of input variables.java.lang.Objecteval(CelVariableResolver resolver)Evaluate a compiled program with a custom variableresolver.java.lang.Objecteval(java.util.Map<java.lang.String,?> mapValue)Evaluate the expression using amapValueas the source of input variables.java.lang.Objecttrace(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(java.util.Map<java.lang.String,?> mapValue, CelEvaluationListener listener)Trace evaluates a compiled program using amapValueas the source of input variables.
-
-
-
Method Detail
-
eval
public java.lang.Object eval() throws CelEvaluationExceptionEvaluate the expression without any variables.- Throws:
CelEvaluationException
-
eval
public java.lang.Object eval(java.util.Map<java.lang.String,?> mapValue) throws CelEvaluationExceptionEvaluate the expression using amapValueas the source of input variables.- Throws:
CelEvaluationException
-
eval
public java.lang.Object eval(Message message) throws CelEvaluationException
Evaluate the expression usingmessagefields as the source of input variables.- Throws:
CelEvaluationException
-
eval
public java.lang.Object eval(CelVariableResolver resolver) throws CelEvaluationException
Evaluate a compiled program with a custom variableresolver.- Throws:
CelEvaluationException
-
trace
public 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
public 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
public java.lang.Object trace(Message message, CelEvaluationListener listener) throws CelEvaluationException
Trace evaluates a compiled program usingmessagefields as the source of input variables. The listener is invoked as evaluation progresses through the AST.- Throws:
CelEvaluationException
-
trace
public 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
-
advanceEvaluation
public 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
-
-