Package org.pgcodekeeper.core.formatter
Class FormatConfiguration
java.lang.Object
org.pgcodekeeper.core.formatter.FormatConfiguration
Configuration class for SQL formatting options.
Controls various aspects of SQL code formatting including indentation,
whitespace handling, and operator spacing.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a copy of this configuration.createIndent(int length) Creates an indentation string based on current configuration.static StringcreateIndent(int length, char indentChar) Creates an indentation string with specified character.intbooleanbooleanbooleanvoidsetAddWhitespaceAfterOp(boolean addWhitespaceAfterOp) voidsetAddWhitespaceBeforeOp(boolean addWhitespaceBeforeOp) voidsetIndentSize(int indentSize) voidsetIndentType(FormatConfiguration.IndentType indentType) voidsetRemoveTrailingWhitespace(boolean removeTrailingWhitespace)
-
Constructor Details
-
FormatConfiguration
public FormatConfiguration()
-
-
Method Details
-
setAddWhitespaceBeforeOp
public void setAddWhitespaceBeforeOp(boolean addWhitespaceBeforeOp) -
setAddWhitespaceAfterOp
public void setAddWhitespaceAfterOp(boolean addWhitespaceAfterOp) -
setRemoveTrailingWhitespace
public void setRemoveTrailingWhitespace(boolean removeTrailingWhitespace) -
setIndentSize
public void setIndentSize(int indentSize) -
isAddWhitespaceAfterOp
public boolean isAddWhitespaceAfterOp() -
isAddWhitespaceBeforeOp
public boolean isAddWhitespaceBeforeOp() -
isRemoveTrailingWhitespace
public boolean isRemoveTrailingWhitespace() -
getIndentSize
public int getIndentSize() -
getIndentType
-
setIndentType
-
createIndent
Creates an indentation string based on current configuration.- Parameters:
length- desired length of indentation- Returns:
- indentation string
-
createIndent
Creates an indentation string with specified character.- Parameters:
length- desired length of indentationindentChar- character to use for indentation- Returns:
- indentation string
-
copy
Creates a copy of this configuration.- Returns:
- new FormatConfiguration with same settings
-