Package spoon.reflect.visitor
Enum Class JavaIdentifiers
- All Implemented Interfaces:
Serializable
,Comparable<JavaIdentifiers>
,Constable
This enum defines the Java keywords and some helper method to determine if
some strings are Java identifiers.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
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 class with the specified name.static JavaIdentifiers[]
values()
Returns an array containing the constants of this enum class, 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 class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class 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
-