Package dev.cel.common
Class CelProtoAbstractSyntaxTree
- java.lang.Object
-
- dev.cel.common.CelProtoAbstractSyntaxTree
-
public final class CelProtoAbstractSyntaxTree extends java.lang.ObjectAn Adapter forCelAbstractSyntaxTreeconstructed from Canonical Protos ofCheckedExprorParsedExprexpressions.Note: Keep this file in sync with
CelProtoV1Alpha1AbstractSyntaxTree
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CelProtoAbstractSyntaxTreefromCelAst(CelAbstractSyntaxTree ast)Constructs CelProtoAbstractSyntaxTree fromCelAbstractSyntaxTree.static CelProtoAbstractSyntaxTreefromCheckedExpr(CheckedExpr checkedExpr)Construct an abstract syntax tree from acom.google.api.expr.CheckedExpr.static CelProtoAbstractSyntaxTreefromParsedExpr(ParsedExpr parsedExpr)Construct an abstract syntax tree from acom.google.api.expr.ParsedExpr.CelAbstractSyntaxTreegetAst()Returns the native representation of the abstract syntax tree:CelAbstractSyntaxTree.ExprgetExpr()Returns the underlyingcom.google.api.expr.Exprrepresentation of the abstract syntax tree.TypegetProtoResultType()For a type checked abstract syntax tree the resulting type is returned in proto format described in checked.proto.SourceInfogetSourceInfo()Returns the underlyingcom.google.api.expr.SourceInforepresentation of the abstract syntax tree.booleanisChecked()Tests whether the underlying abstract syntax tree has been type checked or not.CheckedExprtoCheckedExpr()Returns the underlyingcom.google.api.expr.CheckedExprrepresentation of the abstract syntax tree.ParsedExprtoParsedExpr()Returns the underlyingcom.google.api.expr.ParsedExprrepresentation of the abstract syntax tree.
-
-
-
Method Detail
-
fromCheckedExpr
public static CelProtoAbstractSyntaxTree fromCheckedExpr(CheckedExpr checkedExpr)
Construct an abstract syntax tree from acom.google.api.expr.CheckedExpr.
-
fromParsedExpr
public static CelProtoAbstractSyntaxTree fromParsedExpr(ParsedExpr parsedExpr)
Construct an abstract syntax tree from acom.google.api.expr.ParsedExpr.
-
fromCelAst
public static CelProtoAbstractSyntaxTree fromCelAst(CelAbstractSyntaxTree ast)
Constructs CelProtoAbstractSyntaxTree fromCelAbstractSyntaxTree.
-
isChecked
public boolean isChecked()
Tests whether the underlying abstract syntax tree has been type checked or not.
-
getAst
@CheckReturnValue public CelAbstractSyntaxTree getAst()
Returns the native representation of the abstract syntax tree:CelAbstractSyntaxTree.
-
getExpr
@CheckReturnValue public Expr getExpr()
Returns the underlyingcom.google.api.expr.Exprrepresentation of the abstract syntax tree.
-
toCheckedExpr
@CheckReturnValue public CheckedExpr toCheckedExpr()
Returns the underlyingcom.google.api.expr.CheckedExprrepresentation of the abstract syntax tree. ThrowsIllegalStateExceptionifCelAbstractSyntaxTree.isChecked()is false.
-
getSourceInfo
@CheckReturnValue public SourceInfo getSourceInfo()
Returns the underlyingcom.google.api.expr.SourceInforepresentation of the abstract syntax tree.
-
toParsedExpr
@CheckReturnValue public ParsedExpr toParsedExpr()
Returns the underlyingcom.google.api.expr.ParsedExprrepresentation 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.
-
-