Class CelUnparserVisitor


  • public class CelUnparserVisitor
    extends CelExprVisitor
    Visitor implementation to unparse an AST.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected dev.cel.common.CelAbstractSyntaxTree ast  
      protected static java.lang.String BACKTICK  
      protected static java.lang.String COLON  
      protected static java.lang.String COMMA  
      protected static java.lang.String DOT  
      protected static java.lang.String LEFT_BRACE  
      protected static java.lang.String LEFT_BRACKET  
      protected static java.lang.String LEFT_PAREN  
      protected static java.lang.String QUESTION_MARK  
      protected static java.lang.String RIGHT_BRACE  
      protected static java.lang.String RIGHT_BRACKET  
      protected static java.lang.String RIGHT_PAREN  
      protected dev.cel.common.CelSource sourceInfo  
      protected static java.lang.String SPACE  
      protected java.lang.StringBuilder stringBuilder  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean isBinaryOrTernaryOperator​(dev.cel.common.ast.CelExpr expr)  
      java.lang.String unparse()  
      java.lang.String unparse​(dev.cel.common.ast.CelExpr expr)
      Unparses a specific CelExpr node within the AST.
      void visit​(dev.cel.common.ast.CelExpr expr)
      Visit the expr value, routing to overloads based on the kind of expression.
      protected void visit​(dev.cel.common.ast.CelExpr expr, dev.cel.common.ast.CelConstant constant)
      Visit a CelConstant expression.
      protected void visit​(dev.cel.common.ast.CelExpr expr, dev.cel.common.ast.CelExpr.CelCall call)
      Visit a CelCall expression.
      protected void visit​(dev.cel.common.ast.CelExpr expr, dev.cel.common.ast.CelExpr.CelComprehension comprehension)
      Visit a CelComprehension expression.
      protected void visit​(dev.cel.common.ast.CelExpr expr, dev.cel.common.ast.CelExpr.CelIdent ident)
      Visit an CelIdent expression.
      protected void visit​(dev.cel.common.ast.CelExpr expr, dev.cel.common.ast.CelExpr.CelList list)
      Visit a CelList expression.
      protected void visit​(dev.cel.common.ast.CelExpr expr, dev.cel.common.ast.CelExpr.CelMap map)
      Visit a CelMap expression.
      protected void visit​(dev.cel.common.ast.CelExpr expr, dev.cel.common.ast.CelExpr.CelSelect select)
      Visit a CelSelect expression.
      protected void visit​(dev.cel.common.ast.CelExpr expr, dev.cel.common.ast.CelExpr.CelStruct struct)
      Visit a CelStruct expression.
      protected void visitMaybeNested​(dev.cel.common.ast.CelExpr expr, boolean nested)  
      • Methods inherited from class java.lang.Object

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

      • CelUnparserVisitor

        public CelUnparserVisitor​(dev.cel.common.CelAbstractSyntaxTree ast)
        Creates a new CelUnparserVisitor.
    • Method Detail

      • unparse

        public java.lang.String unparse()
      • unparse

        public java.lang.String unparse​(dev.cel.common.ast.CelExpr expr)
        Unparses a specific CelExpr node within the AST.

        This method exists to allow unparsing of an arbitrary node within the stored AST in this visitor.

      • visit

        public void visit​(dev.cel.common.ast.CelExpr expr)
        Description copied from class: CelExprVisitor
        Visit the expr value, routing to overloads based on the kind of expression.
        Overrides:
        visit in class CelExprVisitor
      • visit

        protected void visit​(dev.cel.common.ast.CelExpr expr,
                             dev.cel.common.ast.CelConstant constant)
        Description copied from class: CelExprVisitor
        Visit a CelConstant expression.
        Overrides:
        visit in class CelExprVisitor
      • visit

        protected void visit​(dev.cel.common.ast.CelExpr expr,
                             dev.cel.common.ast.CelExpr.CelIdent ident)
        Description copied from class: CelExprVisitor
        Visit an CelIdent expression.
        Overrides:
        visit in class CelExprVisitor
      • visit

        protected void visit​(dev.cel.common.ast.CelExpr expr,
                             dev.cel.common.ast.CelExpr.CelSelect select)
        Description copied from class: CelExprVisitor
        Visit a CelSelect expression.
        Overrides:
        visit in class CelExprVisitor
      • visit

        protected void visit​(dev.cel.common.ast.CelExpr expr,
                             dev.cel.common.ast.CelExpr.CelList list)
        Description copied from class: CelExprVisitor
        Visit a CelList expression.
        Overrides:
        visit in class CelExprVisitor
      • visit

        protected void visit​(dev.cel.common.ast.CelExpr expr,
                             dev.cel.common.ast.CelExpr.CelStruct struct)
        Description copied from class: CelExprVisitor
        Visit a CelStruct expression.
        Overrides:
        visit in class CelExprVisitor
      • visit

        protected void visit​(dev.cel.common.ast.CelExpr expr,
                             dev.cel.common.ast.CelExpr.CelMap map)
        Description copied from class: CelExprVisitor
        Visit a CelMap expression.
        Overrides:
        visit in class CelExprVisitor
      • visitMaybeNested

        protected void visitMaybeNested​(dev.cel.common.ast.CelExpr expr,
                                        boolean nested)
      • isBinaryOrTernaryOperator

        protected boolean isBinaryOrTernaryOperator​(dev.cel.common.ast.CelExpr expr)