Package spoon.reflect.visitor
Enum JavaIdentifiers
- All Implemented Interfaces:
Serializable
,Comparable<JavaIdentifiers>
This enum defines the Java keywords and some helper method to determine if
some strings are Java identifiers.
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isLegalJavaExecutableIdentifier(String string)
Checks if a string is a valid Java package identifier.static boolean
isLegalJavaIdentifier(String string)
Checks if a string is a valid Java identifier and not a Java keyword.static boolean
isLegalJavaPackageIdentifier(String string)
Checks if a string is a valid Java package identifier.static JavaIdentifiers
Returns the enum constant of this type with the specified name.static JavaIdentifiers[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
IMPORT
-
PACKAGE
-
INTERFACE
-
CLASS
-
ENUM
-
SUPER
-
THIS
-
ASSERT
-
EXTENDS
-
BREAK
-
CASE
-
CATCH
-
CONTINUE
-
DO
-
FOR
-
IF
-
NEW
-
RETURN
-
SWITCH
-
THROW
-
TRY
-
WHILE
-
PUBLIC
-
PROTECTED
-
PRIVATE
-
ABSTRACT
-
STATIC
-
FINAL
-
TRANSIENT
-
VOLATILE
-
SYNCHRONIZED
-
NATIVE
-
STRICTFP
-
-
Field Details
-
KEYWORDS
Contains the Java keywords.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isLegalJavaIdentifier
Checks if a string is a valid Java identifier and not a Java keyword.- Parameters:
string
- the string to be tested
-
isLegalJavaPackageIdentifier
Checks if a string is a valid Java package identifier.- Parameters:
string
- the string to be tested
-
isLegalJavaExecutableIdentifier
Checks if a string is a valid Java package identifier.- Parameters:
string
- the string to be tested
-