Class FormatConfiguration
java.lang.Object
org.pgcodekeeper.core.database.base.formatter.FormatConfiguration
- All Implemented Interfaces:
IFormatConfiguration
Configuration class for SQL formatting options.
Controls various aspects of SQL code formatting including indentation,
whitespace handling, and operator spacing.
-
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.static FormatConfigurationintbooleanbooleanbooleanvoidsetAddWhitespaceAfterOp(boolean addWhitespaceAfterOp) voidsetAddWhitespaceBeforeOp(boolean addWhitespaceBeforeOp) voidsetIndentSize(int indentSize) voidsetIndentType(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()- Specified by:
isAddWhitespaceAfterOpin interfaceIFormatConfiguration- Returns:
- true if space should be added after operators
-
isAddWhitespaceBeforeOp
public boolean isAddWhitespaceBeforeOp()- Specified by:
isAddWhitespaceBeforeOpin interfaceIFormatConfiguration- Returns:
- true if space should be added before operators
-
isRemoveTrailingWhitespace
public boolean isRemoveTrailingWhitespace()- Specified by:
isRemoveTrailingWhitespacein interfaceIFormatConfiguration- Returns:
- true if trailing spaces should be removed
-
getIndentSize
public int getIndentSize()- Specified by:
getIndentSizein interfaceIFormatConfiguration- Returns:
- indent size
-
getIndentType
- Specified by:
getIndentTypein interfaceIFormatConfiguration- Returns:
- indent type
- See Also:
-
setIndentType
-
createIndent
Description copied from interface:IFormatConfigurationCreates an indentation string based on current configuration.- Specified by:
createIndentin interfaceIFormatConfiguration- 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
-
getDefaultConfig
-