Class CompiledProgram

java.lang.Object
build.buf.protovalidate.internal.expression.CompiledProgram

public class CompiledProgram extends Object
CompiledProgram is a parsed and type-checked Program along with the source Expression.
  • Constructor Details

    • CompiledProgram

      public CompiledProgram(org.projectnessie.cel.Program program, Expression source)
      Constructs a new CompiledProgram.
      Parameters:
      program - The compiled CEL program.
      source - The original expression that was compiled into the program.
  • Method Details

    • eval

      @Nullable public build.buf.gen.buf.validate.Violation eval(Variable bindings) throws ExecutionException
      Evaluate the compiled program with a given set of Variable bindings.
      Parameters:
      bindings - Variable bindings used for the evaluation.
      Returns:
      The Violation from the evaluation, or null if there are no violations.
      Throws:
      ExecutionException - If the evaluation of the CEL program fails with an error.