Class JavaKeywords
java.lang.Object
tech.picnic.errorprone.bugpatterns.util.JavaKeywords
Utility class that can be used to identify reserved keywords of the Java language.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanTells whether the given string is a contextual keyword in the Java language.static booleanTells whether the given string is a reserved or contextual keyword in the Java language.static booleanisReservedKeyword(String str) Tells whether the given string is a reserved keyword in the Java language.
-
Method Details
-
isReservedKeyword
Tells whether the given string is a reserved keyword in the Java language.- Parameters:
str- The string of interest.- Returns:
trueif the given string is a reserved keyword in the Java language.
-
isContextualKeyword
Tells whether the given string is a contextual keyword in the Java language.- Parameters:
str- The string of interest.- Returns:
trueif the given string is a contextual keyword in the Java language.
-
isKeyword
Tells whether the given string is a reserved or contextual keyword in the Java language.- Parameters:
str- The string of interest.- Returns:
trueif the given string is a reserved or contextual keyword in the Java language.
-