Enum SqlWriter.FrameTypeEnum

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean needsIndent  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FrameTypeEnum()
      Creates a list type.
      private FrameTypeEnum​(boolean needsIndent)
      Creates a list type.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static SqlWriter.FrameType create​(java.lang.String name)
      Creates a frame type.
      java.lang.String getName()
      Returns the name of this frame type.
      boolean needsIndent()
      Returns whether this frame type should cause the code be further indented.
      static SqlWriter.FrameTypeEnum valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static SqlWriter.FrameTypeEnum[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • SELECT

        public static final SqlWriter.FrameTypeEnum SELECT
        SELECT query (or UPDATE or DELETE). The items in the list are the clauses: FROM, WHERE, etc.
      • WINDOW_DECL_LIST

        public static final SqlWriter.FrameTypeEnum WINDOW_DECL_LIST
        The WINDOW clause of a SELECT statement.
      • UPDATE_SET_LIST

        public static final SqlWriter.FrameTypeEnum UPDATE_SET_LIST
        The SET clause of an UPDATE statement.
      • FUN_CALL

        public static final SqlWriter.FrameTypeEnum FUN_CALL
        Function call or datatype declaration.

        Examples:

        • SUBSTRING('foobar' FROM 1 + 2 TO 4)
        • DECIMAL(10, 5)
      • WINDOW

        public static final SqlWriter.FrameTypeEnum WINDOW
        Window specification.

        Examples:

        • SUM(x) OVER (ORDER BY hireDate ROWS 3 PRECEDING)
        • WINDOW w1 AS (ORDER BY hireDate), w2 AS (w1 PARTITION BY gender RANGE BETWEEN INTERVAL '1' YEAR PRECEDING AND '2' MONTH PRECEDING)
      • ORDER_BY

        public static final SqlWriter.FrameTypeEnum ORDER_BY
        ORDER BY clause of a SELECT statement. The "list" has only two items: the query and the order by clause, with ORDER BY as the separator.
      • ORDER_BY_LIST

        public static final SqlWriter.FrameTypeEnum ORDER_BY_LIST
        ORDER BY list.

        Example:

        • ORDER BY x, y DESC, z
      • WITH

        public static final SqlWriter.FrameTypeEnum WITH
        WITH clause of a SELECT statement. The "list" has only two items: the WITH clause and the query, with AS as the separator.
      • GROUP_BY_LIST

        public static final SqlWriter.FrameTypeEnum GROUP_BY_LIST
        GROUP BY list.

        Example:

        • GROUP BY x, FLOOR(y)
      • SUB_QUERY

        public static final SqlWriter.FrameTypeEnum SUB_QUERY
        Sub-query list. Encloses a SELECT, UNION, EXCEPT, INTERSECT query with optional ORDER BY.

        Example:

        • GROUP BY x, FLOOR(y)
      • SETOP

        public static final SqlWriter.FrameTypeEnum SETOP
        Set operation.

        Example:

        • SELECT * FROM a UNION SELECT * FROM b
    • Field Detail

      • needsIndent

        private final boolean needsIndent
    • Constructor Detail

      • FrameTypeEnum

        private FrameTypeEnum()
        Creates a list type.
      • FrameTypeEnum

        private FrameTypeEnum​(boolean needsIndent)
        Creates a list type.
    • Method Detail

      • values

        public static SqlWriter.FrameTypeEnum[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SqlWriter.FrameTypeEnum c : SqlWriter.FrameTypeEnum.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SqlWriter.FrameTypeEnum valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • needsIndent

        public boolean needsIndent()
        Description copied from interface: SqlWriter.FrameType
        Returns whether this frame type should cause the code be further indented.
        Specified by:
        needsIndent in interface SqlWriter.FrameType
        Returns:
        whether to further indent code within a frame of this type
      • create

        public static SqlWriter.FrameType create​(java.lang.String name)
        Creates a frame type.
        Parameters:
        name - Name
        Returns:
        frame type