Class PgFormatterUtils

java.lang.Object
org.pgcodekeeper.core.formatter.pg.PgFormatterUtils

public class PgFormatterUtils extends Object
Utility class containing PostgreSQL-specific formatting helper methods. Provides common operations for identifying and handling SQL operators.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    checkOperator(org.antlr.v4.runtime.Token t, int type, List<? extends org.antlr.v4.runtime.Token> tokens)
    Validates whether a token should be treated as an operator in its context.
    static boolean
    isOperatorToken(int type)
    Checks if a token type represents a SQL operator.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isOperatorToken

      public static boolean isOperatorToken(int type)
      Checks if a token type represents a SQL operator.
      Parameters:
      type - The token type to check (from SQLLexer)
      Returns:
      true if the token type is a recognized operator, false otherwise
    • checkOperator

      public static boolean checkOperator(org.antlr.v4.runtime.Token t, int type, List<? extends org.antlr.v4.runtime.Token> tokens)
      Validates whether a token should be treated as an operator in its context.
      Parameters:
      t - The token being checked
      type - The token type (from SQLLexer)
      tokens - The complete list of tokens for context analysis
      Returns:
      true if the token should be treated as an operator, false otherwise