Class FormatConfiguration

java.lang.Object
org.pgcodekeeper.core.formatter.FormatConfiguration

public class FormatConfiguration extends Object
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()
    • isAddWhitespaceBeforeOp

      public boolean isAddWhitespaceBeforeOp()
    • isRemoveTrailingWhitespace

      public boolean isRemoveTrailingWhitespace()
    • getIndentSize

      public int getIndentSize()
    • getIndentType

      public FormatConfiguration.IndentType getIndentType()
    • setIndentType

      public void setIndentType(FormatConfiguration.IndentType indentType)
    • createIndent

      public String createIndent(int length)
      Creates an indentation string based on current configuration.
      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