Package spoon.reflect.visitor
Enum JavaIdentifiers
- java.lang.Object
-
- java.lang.Enum<JavaIdentifiers>
-
- spoon.reflect.visitor.JavaIdentifiers
-
- All Implemented Interfaces:
Serializable
,Comparable<JavaIdentifiers>
public enum JavaIdentifiers extends Enum<JavaIdentifiers>
This enum defines the Java keywords and some helper method to determine if some strings are Java identifiers.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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
valueOf(String name)
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 Detail
-
IMPORT
public static final JavaIdentifiers IMPORT
-
PACKAGE
public static final JavaIdentifiers PACKAGE
-
INTERFACE
public static final JavaIdentifiers INTERFACE
-
CLASS
public static final JavaIdentifiers CLASS
-
ENUM
public static final JavaIdentifiers ENUM
-
SUPER
public static final JavaIdentifiers SUPER
-
THIS
public static final JavaIdentifiers THIS
-
ASSERT
public static final JavaIdentifiers ASSERT
-
EXTENDS
public static final JavaIdentifiers EXTENDS
-
BREAK
public static final JavaIdentifiers BREAK
-
CASE
public static final JavaIdentifiers CASE
-
CATCH
public static final JavaIdentifiers CATCH
-
CONTINUE
public static final JavaIdentifiers CONTINUE
-
DO
public static final JavaIdentifiers DO
-
FOR
public static final JavaIdentifiers FOR
-
IF
public static final JavaIdentifiers IF
-
NEW
public static final JavaIdentifiers NEW
-
RETURN
public static final JavaIdentifiers RETURN
-
SWITCH
public static final JavaIdentifiers SWITCH
-
THROW
public static final JavaIdentifiers THROW
-
TRY
public static final JavaIdentifiers TRY
-
WHILE
public static final JavaIdentifiers WHILE
-
PUBLIC
public static final JavaIdentifiers PUBLIC
-
PROTECTED
public static final JavaIdentifiers PROTECTED
-
PRIVATE
public static final JavaIdentifiers PRIVATE
-
ABSTRACT
public static final JavaIdentifiers ABSTRACT
-
STATIC
public static final JavaIdentifiers STATIC
-
FINAL
public static final JavaIdentifiers FINAL
-
TRANSIENT
public static final JavaIdentifiers TRANSIENT
-
VOLATILE
public static final JavaIdentifiers VOLATILE
-
SYNCHRONIZED
public static final JavaIdentifiers SYNCHRONIZED
-
NATIVE
public static final JavaIdentifiers NATIVE
-
STRICTFP
public static final JavaIdentifiers STRICTFP
-
-
Method Detail
-
values
public static JavaIdentifiers[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (JavaIdentifiers c : JavaIdentifiers.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JavaIdentifiers valueOf(String name)
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
public static boolean isLegalJavaIdentifier(String string)
Checks if a string is a valid Java identifier and not a Java keyword.- Parameters:
string
- the string to be tested
-
isLegalJavaPackageIdentifier
public static boolean isLegalJavaPackageIdentifier(String string)
Checks if a string is a valid Java package identifier.- Parameters:
string
- the string to be tested
-
isLegalJavaExecutableIdentifier
public static boolean isLegalJavaExecutableIdentifier(String string)
Checks if a string is a valid Java package identifier.- Parameters:
string
- the string to be tested
-
-