@Value.Immutable
public interface SqlWriterConfig
SqlWriter and SqlPrettyWriter.| Modifier and Type | Interface and Description |
|---|---|
static class |
SqlWriterConfig.LineFolding
Policy for how to do deal with long lines.
|
| Modifier and Type | Method and Description |
|---|---|
default boolean |
alwaysUseParentheses()
Returns whether expressions should always be included in parentheses.
|
default boolean |
caseClausesOnNewLines()
Returns whether the WHEN, THEN and ELSE clauses of a CASE expression
appear at the start of a new line.
|
default boolean |
clauseEndsLine()
Returns whether a clause (FROM, WHERE, GROUP BY, HAVING, WINDOW,
ORDER BY) is followed by a new line.
|
default boolean |
clauseStartsLine()
Returns whether a clause (FROM, WHERE, GROUP BY, HAVING, WINDOW,
ORDER BY) starts a new line.
|
@Nullable SqlDialect |
dialect()
Returns the dialect.
|
default int |
foldLength()
Returns the line length at which items are chopped or folded (for clauses
that have chosen
SqlWriterConfig.LineFolding.CHOP or SqlWriterConfig.LineFolding.FOLD). |
default SqlWriterConfig.LineFolding |
fromFolding()
Returns the line-folding policy for the FROM clause (and JOIN).
|
@Nullable SqlWriterConfig.LineFolding |
groupByFolding()
Returns the line-folding policy for the GROUP BY clause.
|
@Nullable SqlWriterConfig.LineFolding |
havingFolding()
Returns the line-folding policy for the HAVING clause.
|
default int |
indentation()
Returns the number of spaces indentation.
|
default boolean |
keywordsLowerCase()
Returns whether to print keywords (SELECT, AS, etc.) in lower-case.
|
default boolean |
leadingComma()
Returns whether commas in SELECT, GROUP BY and ORDER clauses should
appear at the start of the line.
|
@Nullable SqlWriterConfig.LineFolding |
lineFolding()
Returns the line-folding policy for lists in the SELECT, GROUP BY and
ORDER clauses, for items in the SET clause of UPDATE, and for items in
VALUES.
|
default int |
lineLength()
Returns the maximum line length.
|
@Nullable SqlWriterConfig.LineFolding |
matchFolding()
Returns the line-folding policy for the MATCH_RECOGNIZE clause.
|
static SqlWriterConfig |
of()
Create a default SqlWriterConfig object.
|
@Nullable SqlWriterConfig.LineFolding |
orderByFolding()
Returns the line-folding policy for the ORDER BY clause.
|
@Nullable SqlWriterConfig.LineFolding |
overFolding()
Returns the line-folding policy for the OVER clause or a window
declaration.
|
default boolean |
quoteAllIdentifiers()
Returns whether to quote all identifiers, even those which would be
correct according to the rules of the
SqlDialect if quotation
marks were omitted. |
@Nullable SqlWriterConfig.LineFolding |
selectFolding()
Returns the line-folding policy for the SELECT clause.
|
default boolean |
selectListExtraIndentFlag()
Returns whether to use a fix for SELECT list indentations.
|
default boolean |
selectListItemsOnSeparateLines()
Returns whether each item in a SELECT list, GROUP BY list, or ORDER BY
list is on its own line.
|
default SqlWriter.SubQueryStyle |
subQueryStyle()
Returns the sub-query style.
|
@Nullable SqlWriterConfig.LineFolding |
updateSetFolding()
Returns the line-folding policy for the SET clause of an UPDATE statement.
|
default boolean |
updateSetListNewline()
Returns whether each assignment in the SET clause of an UPDATE or MERGE
statement should be on its own line.
|
@Nullable SqlWriterConfig.LineFolding |
valuesFolding()
Returns the line-folding policy for the VALUES expression.
|
default boolean |
valuesListNewline()
Returns whether each row in a VALUES clause should be on its own
line.
|
@Nullable SqlWriterConfig.LineFolding |
whereFolding()
Returns the line-folding policy for the WHERE clause.
|
default boolean |
whereListItemsOnSeparateLines()
Returns whether to print a newline before each AND or OR (whichever is
higher level) in WHERE clauses.
|
default boolean |
windowDeclListNewline()
Returns whether each declaration in a WINDOW clause should be on its own
line.
|
@Nullable SqlWriterConfig.LineFolding |
windowFolding()
Returns the line-folding policy for the WINDOW clause.
|
default boolean |
windowNewline()
Returns whether a WINDOW clause should start its own line.
|
SqlWriterConfig |
withAlwaysUseParentheses(boolean alwaysUseParentheses)
Sets
alwaysUseParentheses(). |
SqlWriterConfig |
withCaseClausesOnNewLines(boolean caseClausesOnNewLines)
Sets
caseClausesOnNewLines(). |
SqlWriterConfig |
withClauseEndsLine(boolean clauseEndsLine)
Sets
clauseEndsLine(). |
SqlWriterConfig |
withClauseStartsLine(boolean clauseStartsLine)
Sets
clauseStartsLine(). |
SqlWriterConfig |
withDialect(@Nullable SqlDialect dialect)
Sets
dialect(). |
SqlWriterConfig |
withFoldLength(int lineLength)
Sets
foldLength(). |
SqlWriterConfig |
withFromFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
fromFolding(). |
SqlWriterConfig |
withGroupByFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
groupByFolding(). |
SqlWriterConfig |
withHavingFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
havingFolding(). |
SqlWriterConfig |
withIndentation(int indentation)
Sets
indentation(). |
SqlWriterConfig |
withKeywordsLowerCase(boolean keywordsLowerCase)
Sets
keywordsLowerCase(). |
SqlWriterConfig |
withLeadingComma(boolean leadingComma)
Sets
leadingComma(). |
SqlWriterConfig |
withLineFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
lineFolding(). |
SqlWriterConfig |
withLineLength(int lineLength)
Sets
lineLength(). |
SqlWriterConfig |
withMatchFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
matchFolding(). |
SqlWriterConfig |
withOrderByFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
orderByFolding(). |
SqlWriterConfig |
withOverFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
overFolding(). |
SqlWriterConfig |
withQuoteAllIdentifiers(boolean quoteAllIdentifiers)
Sets
quoteAllIdentifiers(). |
SqlWriterConfig |
withSelectFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
selectFolding(). |
SqlWriterConfig |
withSelectListExtraIndentFlag(boolean selectListExtraIndentFlag)
|
SqlWriterConfig |
withSelectListItemsOnSeparateLines(boolean selectListItemsOnSeparateLines)
|
SqlWriterConfig |
withSubQueryStyle(SqlWriter.SubQueryStyle subQueryStyle)
Sets
subQueryStyle(). |
SqlWriterConfig |
withUpdateSetFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
updateSetFolding(). |
SqlWriterConfig |
withUpdateSetListNewline(boolean updateSetListNewline)
Sets
updateSetListNewline(). |
SqlWriterConfig |
withValuesFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
valuesFolding(). |
SqlWriterConfig |
withValuesListNewline(boolean valuesListNewline)
Sets
valuesListNewline(). |
SqlWriterConfig |
withWhereFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
whereFolding(). |
SqlWriterConfig |
withWhereListItemsOnSeparateLines(boolean whereListItemsOnSeparateLines)
|
SqlWriterConfig |
withWindowDeclListNewline(boolean windowDeclListNewline)
Sets
windowDeclListNewline(). |
SqlWriterConfig |
withWindowFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
Sets
windowFolding(). |
SqlWriterConfig |
withWindowNewline(boolean windowNewline)
Sets
windowNewline(). |
@Nullable SqlDialect dialect()
SqlWriterConfig withDialect(@Nullable SqlDialect dialect)
dialect().@Value.Default default boolean keywordsLowerCase()
SqlWriterConfig withKeywordsLowerCase(boolean keywordsLowerCase)
keywordsLowerCase().@Value.Default default boolean quoteAllIdentifiers()
SqlDialect if quotation
marks were omitted. Default is true.SqlWriterConfig withQuoteAllIdentifiers(boolean quoteAllIdentifiers)
quoteAllIdentifiers().@Value.Default default int indentation()
SqlWriterConfig withIndentation(int indentation)
indentation().@Value.Default default boolean clauseStartsLine()
SqlWriterConfig withClauseStartsLine(boolean clauseStartsLine)
clauseStartsLine().@Value.Default default boolean clauseEndsLine()
SqlWriterConfig withClauseEndsLine(boolean clauseEndsLine)
clauseEndsLine().@Value.Default default boolean selectListItemsOnSeparateLines()
Default is false;
this property is superseded by selectFolding(),
groupByFolding(), orderByFolding().
SqlWriterConfig withSelectListItemsOnSeparateLines(boolean selectListItemsOnSeparateLines)
@Nullable SqlWriterConfig.LineFolding lineFolding()
SqlWriterConfig withLineFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
lineFolding().@Nullable SqlWriterConfig.LineFolding selectFolding()
lineFolding() is used.SqlWriterConfig withSelectFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
selectFolding().@Value.Default default SqlWriterConfig.LineFolding fromFolding()
lineFolding() is used.SqlWriterConfig withFromFolding(SqlWriterConfig.LineFolding lineFolding)
fromFolding().@Nullable SqlWriterConfig.LineFolding whereFolding()
lineFolding() is used.SqlWriterConfig withWhereFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
whereFolding().@Nullable SqlWriterConfig.LineFolding groupByFolding()
lineFolding() is used.SqlWriterConfig withGroupByFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
groupByFolding().@Nullable SqlWriterConfig.LineFolding havingFolding()
lineFolding() is used.SqlWriterConfig withHavingFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
havingFolding().@Nullable SqlWriterConfig.LineFolding windowFolding()
lineFolding() is used.SqlWriterConfig withWindowFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
windowFolding().@Nullable SqlWriterConfig.LineFolding matchFolding()
lineFolding() is used.SqlWriterConfig withMatchFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
matchFolding().@Nullable SqlWriterConfig.LineFolding orderByFolding()
lineFolding() is used.SqlWriterConfig withOrderByFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
orderByFolding().@Nullable SqlWriterConfig.LineFolding overFolding()
lineFolding() is used.SqlWriterConfig withOverFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
overFolding().@Nullable SqlWriterConfig.LineFolding valuesFolding()
lineFolding() is used.SqlWriterConfig withValuesFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
valuesFolding().@Nullable SqlWriterConfig.LineFolding updateSetFolding()
lineFolding() is used.SqlWriterConfig withUpdateSetFolding(@Nullable SqlWriterConfig.LineFolding lineFolding)
updateSetFolding().@Value.Default default boolean selectListExtraIndentFlag()
SELECT
A as A,
B as B,
C as C,
D
SELECT
A as A,
B as B,
C as C,
D
SqlWriterConfig withSelectListExtraIndentFlag(boolean selectListExtraIndentFlag)
@Value.Default default boolean windowDeclListNewline()
Default is true;
this property is superseded by windowFolding().
SqlWriterConfig withWindowDeclListNewline(boolean windowDeclListNewline)
windowDeclListNewline().@Value.Default default boolean valuesListNewline()
Default is true;
this property is superseded by valuesFolding().
SqlWriterConfig withValuesListNewline(boolean valuesListNewline)
valuesListNewline().@Value.Default default boolean updateSetListNewline()
Default is true;
this property is superseded by updateSetFolding().
SqlWriterConfig withUpdateSetListNewline(boolean updateSetListNewline)
updateSetListNewline().@Value.Default default boolean windowNewline()
SqlWriterConfig withWindowNewline(boolean windowNewline)
windowNewline().@Value.Default default boolean leadingComma()
SqlWriterConfig withLeadingComma(boolean leadingComma)
leadingComma().@Value.Default default SqlWriter.SubQueryStyle subQueryStyle()
SqlWriter.SubQueryStyle.HYDE.SqlWriterConfig withSubQueryStyle(SqlWriter.SubQueryStyle subQueryStyle)
subQueryStyle().@Value.Default default boolean whereListItemsOnSeparateLines()
NOTE: Ignored when alwaysUseParentheses is set to true.
SqlWriterConfig withWhereListItemsOnSeparateLines(boolean whereListItemsOnSeparateLines)
@Value.Default default boolean alwaysUseParentheses()
SqlWriterConfig withAlwaysUseParentheses(boolean alwaysUseParentheses)
alwaysUseParentheses().@Value.Default default int lineLength()
SqlWriterConfig withLineLength(int lineLength)
lineLength().@Value.Default default int foldLength()
SqlWriterConfig.LineFolding.CHOP or SqlWriterConfig.LineFolding.FOLD).
Default is 80.SqlWriterConfig withFoldLength(int lineLength)
foldLength().@Value.Default default boolean caseClausesOnNewLines()
SqlWriterConfig withCaseClausesOnNewLines(boolean caseClausesOnNewLines)
caseClausesOnNewLines().static SqlWriterConfig of()
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.