Class CelProtoAbstractSyntaxTree


  • public final class CelProtoAbstractSyntaxTree
    extends java.lang.Object
    An Adapter for CelAbstractSyntaxTree constructed from Canonical Protos of CheckedExpr or ParsedExpr expressions.

    Note: Keep this file in sync with CelProtoV1Alpha1AbstractSyntaxTree

    • Method Detail

      • fromCelAst

        public static CelProtoAbstractSyntaxTree fromCelAst​(dev.cel.common.CelAbstractSyntaxTree ast)
        Constructs CelProtoAbstractSyntaxTree from CelAbstractSyntaxTree.
      • isChecked

        public boolean isChecked()
        Tests whether the underlying abstract syntax tree has been type checked or not.
      • getAst

        @CheckReturnValue
        public dev.cel.common.CelAbstractSyntaxTree getAst()
        Returns the native representation of the abstract syntax tree: CelAbstractSyntaxTree.
      • getExpr

        @CheckReturnValue
        public Expr getExpr()
        Returns the underlying Expr representation of the abstract syntax tree.
      • toCheckedExpr

        @CheckReturnValue
        public CheckedExpr toCheckedExpr()
        Returns the underlying CheckedExpr representation of the abstract syntax tree. Throws IllegalStateException if CelAbstractSyntaxTree.isChecked() is false.
      • getSourceInfo

        @CheckReturnValue
        public SourceInfo getSourceInfo()
        Returns the underlying SourceInfo representation of the abstract syntax tree.
      • toParsedExpr

        @CheckReturnValue
        public ParsedExpr toParsedExpr()
        Returns the underlying ParsedExpr representation of the abstract syntax tree.
      • getProtoResultType

        @CheckReturnValue
        public Type getProtoResultType()
        For a type checked abstract syntax tree the resulting type is returned in proto format described in checked.proto. Otherwise, the dynamic type is returned.