Class JavaKeywords

java.lang.Object
tech.picnic.errorprone.bugpatterns.util.JavaKeywords

public final class JavaKeywords extends Object
Utility class that can be used to identify reserved keywords of the Java language.
  • Method Details

    • isReservedKeyword

      public static boolean isReservedKeyword(String str)
      Tells whether the given string is a reserved keyword in the Java language.
      Parameters:
      str - The string of interest.
      Returns:
      true if the given string is a reserved keyword in the Java language.
    • isContextualKeyword

      public static boolean isContextualKeyword(String str)
      Tells whether the given string is a contextual keyword in the Java language.
      Parameters:
      str - The string of interest.
      Returns:
      true if the given string is a contextual keyword in the Java language.
    • isKeyword

      public static boolean isKeyword(String str)
      Tells whether the given string is a reserved or contextual keyword in the Java language.
      Parameters:
      str - The string of interest.
      Returns:
      true if the given string is a reserved or contextual keyword in the Java language.