Class SqlFormatOptions

java.lang.Object
org.apache.calcite.sql.pretty.SqlFormatOptions

public class SqlFormatOptions extends Object
Data structure to hold options for SqlPrettyWriter.setFormatOptions(SqlFormatOptions).
  • Constructor Details

    • SqlFormatOptions

      public SqlFormatOptions()
      Constructs a set of default SQL format options.
    • SqlFormatOptions

      public SqlFormatOptions(boolean alwaysUseParentheses, boolean caseClausesOnNewLines, boolean clauseStartsLine, boolean keywordsLowercase, boolean quoteAllIdentifiers, boolean selectListItemsOnSeparateLines, boolean whereListItemsOnSeparateLines, boolean windowDeclarationStartsLine, boolean windowListItemsOnSeparateLines, int indentation, int lineLength)
      Constructs a complete set of SQL format options.
      Parameters:
      alwaysUseParentheses - Always use parentheses
      caseClausesOnNewLines - Case clauses on new lines
      clauseStartsLine - Clause starts line
      keywordsLowercase - Keywords in lower case
      quoteAllIdentifiers - Quote all identifiers
      selectListItemsOnSeparateLines - Select items on separate lines
      whereListItemsOnSeparateLines - Where items on separate lines
      windowDeclarationStartsLine - Window declaration starts line
      windowListItemsOnSeparateLines - Window list items on separate lines
      indentation - Indentation
      lineLength - Line length
  • Method Details

    • isAlwaysUseParentheses

      public boolean isAlwaysUseParentheses()
    • setAlwaysUseParentheses

      public void setAlwaysUseParentheses(boolean alwaysUseParentheses)
    • isCaseClausesOnNewLines

      public boolean isCaseClausesOnNewLines()
    • setCaseClausesOnNewLines

      public void setCaseClausesOnNewLines(boolean caseClausesOnNewLines)
    • isClauseStartsLine

      public boolean isClauseStartsLine()
    • setClauseStartsLine

      public void setClauseStartsLine(boolean clauseStartsLine)
    • isKeywordsLowercase

      public boolean isKeywordsLowercase()
    • setKeywordsLowercase

      public void setKeywordsLowercase(boolean keywordsLowercase)
    • isQuoteAllIdentifiers

      public boolean isQuoteAllIdentifiers()
    • setQuoteAllIdentifiers

      public void setQuoteAllIdentifiers(boolean quoteAllIdentifiers)
    • isSelectListItemsOnSeparateLines

      public boolean isSelectListItemsOnSeparateLines()
    • setSelectListItemsOnSeparateLines

      public void setSelectListItemsOnSeparateLines(boolean selectListItemsOnSeparateLines)
    • isWhereListItemsOnSeparateLines

      public boolean isWhereListItemsOnSeparateLines()
    • setWhereListItemsOnSeparateLines

      public void setWhereListItemsOnSeparateLines(boolean whereListItemsOnSeparateLines)
    • isWindowDeclarationStartsLine

      public boolean isWindowDeclarationStartsLine()
    • setWindowDeclarationStartsLine

      public void setWindowDeclarationStartsLine(boolean windowDeclarationStartsLine)
    • isWindowListItemsOnSeparateLines

      public boolean isWindowListItemsOnSeparateLines()
    • setWindowListItemsOnSeparateLines

      public void setWindowListItemsOnSeparateLines(boolean windowListItemsOnSeparateLines)
    • getLineLength

      public int getLineLength()
    • setLineLength

      public void setLineLength(int lineLength)
    • getIndentation

      public int getIndentation()
    • setIndentation

      public void setIndentation(int indentation)