Package org.pgcodekeeper.core.formatter
Class FileFormatter
java.lang.Object
org.pgcodekeeper.core.formatter.FileFormatter
Main formatter class that handles SQL file formatting for different database types.
Acts as a facade that delegates to specific database formatter implementations.
-
Constructor Summary
ConstructorsConstructorDescriptionFileFormatter(String source, int offset, int length, FormatConfiguration config, DatabaseType dbType) Constructs a new FileFormatter instance. -
Method Summary
Modifier and TypeMethodDescriptionFormats the source text according to configuration and database type.Gets the list of formatting operations that would be applied.
-
Constructor Details
-
FileFormatter
public FileFormatter(String source, int offset, int length, FormatConfiguration config, DatabaseType dbType) Constructs a new FileFormatter instance.- Parameters:
source- The source SQL text to formatoffset- Starting offset in the source textlength- Length of text to formatconfig- Formatting configuration optionsdbType- Target database type for dialect-specific formatting
-
-
Method Details
-
formatText
Formats the source text according to configuration and database type.- Returns:
- Formatted SQL string
-
getFormatItems
Gets the list of formatting operations that would be applied. This allows inspection of formatting changes without actually modifying the text.- Returns:
- List of FormatItem objects representing formatting operations
-