Class ExpressionWriter


  • class ExpressionWriter
    extends java.lang.Object
    Converts an expression to Java code.
    • Field Detail

      • INDENT

        private static final int INDENT
        How many spaces to indent Java code.
        See Also:
        Constant Field Values
      • spacer

        private final org.apache.calcite.avatica.util.Spacer spacer
      • buf

        private final java.lang.StringBuilder buf
      • indentPending

        private boolean indentPending
      • generics

        private final boolean generics
    • Constructor Detail

      • ExpressionWriter

        ExpressionWriter()
      • ExpressionWriter

        ExpressionWriter​(boolean generics)
    • Method Detail

      • write

        public void write​(Node expression)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • requireParentheses

        public boolean requireParentheses​(Expression expression,
                                          int lprec,
                                          int rprec)
        If parentheses are required, writes this expression out with parentheses and returns true. If they are not required, does nothing and returns false.
      • begin

        public void begin()
        Increases the indentation level.
      • end

        public void end()
        Decreases the indentation level.
      • checkIndent

        private void checkIndent()
      • getBuf

        public java.lang.StringBuilder getBuf()
      • list

        public ExpressionWriter list​(java.lang.String begin,
                                     java.lang.String sep,
                                     java.lang.String end,
                                     java.lang.Iterable<?> list)
      • backUp

        public void backUp()