Class HighlightingFormatter

java.lang.Object
org.hibernate.engine.jdbc.internal.HighlightingFormatter
All Implemented Interfaces:
Formatter

public final class HighlightingFormatter extends Object implements Formatter
Performs basic syntax highlighting for SQL using ANSI escape codes.
  • Field Details

    • INSTANCE

      public static final Formatter INSTANCE
  • Constructor Details

    • HighlightingFormatter

      public HighlightingFormatter(String keywordCode, String stringCode, String quotedCode)
      Parameters:
      keywordCode - the ANSI escape code to use for highlighting SQL keywords
      stringCode - the ANSI escape code to use for highlighting SQL strings
  • Method Details

    • format

      public String format(String sql)
      Description copied from interface: Formatter
      Format the source SQL string.
      Specified by:
      format in interface Formatter
      Parameters:
      sql - The original SQL string
      Returns:
      The formatted version