Class CelExprUtil


  • public final class CelExprUtil
    extends java.lang.Object
    Utility class for working with CelExpr.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object evaluateExpr​(Cel cel, CelExpr expr)
      Type-checks and evaluates a CelExpr.
      static java.lang.Object evaluateExpr​(Cel cel, CelExpr expr, java.lang.Class<?> expectedResultType)
      Type-checks and evaluates a CelExpr.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • evaluateExpr

        @CanIgnoreReturnValue
        public static java.lang.Object evaluateExpr​(Cel cel,
                                                    CelExpr expr,
                                                    java.lang.Class<?> expectedResultType)
                                             throws CelValidationException,
                                                    CelEvaluationException
        Type-checks and evaluates a CelExpr. The evaluated result is then checked to see if it's the expected result type.

        This method should be used in the context of validating or optimizing an AST.

        Returns:
        Evaluated result.
        Throws:
        CelValidationException - if CelExpr fails to type-check.
        CelEvaluationException - if CelExpr fails to evaluate.
        java.lang.IllegalStateException - if the evaluated result is not of type expectedResultType.