Class FormatConfiguration

java.lang.Object
org.pgcodekeeper.core.database.base.formatter.FormatConfiguration
All Implemented Interfaces:
IFormatConfiguration

public class FormatConfiguration extends Object implements IFormatConfiguration
Configuration class for SQL formatting options. Controls various aspects of SQL code formatting including indentation, whitespace handling, and operator spacing.
  • 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:
      isAddWhitespaceAfterOp in interface IFormatConfiguration
      Returns:
      true if space should be added after operators
    • isAddWhitespaceBeforeOp

      public boolean isAddWhitespaceBeforeOp()
      Specified by:
      isAddWhitespaceBeforeOp in interface IFormatConfiguration
      Returns:
      true if space should be added before operators
    • isRemoveTrailingWhitespace

      public boolean isRemoveTrailingWhitespace()
      Specified by:
      isRemoveTrailingWhitespace in interface IFormatConfiguration
      Returns:
      true if trailing spaces should be removed
    • getIndentSize

      public int getIndentSize()
      Specified by:
      getIndentSize in interface IFormatConfiguration
      Returns:
      indent size
    • getIndentType

      public IndentType getIndentType()
      Specified by:
      getIndentType in interface IFormatConfiguration
      Returns:
      indent type
      See Also:
    • setIndentType

      public void setIndentType(IndentType indentType)
    • createIndent

      public String createIndent(int length)
      Description copied from interface: IFormatConfiguration
      Creates an indentation string based on current configuration.
      Specified by:
      createIndent in interface IFormatConfiguration
      Parameters:
      length - desired length of indentation
      Returns:
      indentation string
    • createIndent

      public static String createIndent(int length, char indentChar)
      Creates an indentation string with specified character.
      Parameters:
      length - desired length of indentation
      indentChar - character to use for indentation
      Returns:
      indentation string
    • copy

      public FormatConfiguration copy()
      Creates a copy of this configuration.
      Returns:
      new FormatConfiguration with same settings
    • getDefaultConfig

      public static FormatConfiguration getDefaultConfig()