public enum ElementKind extends Enum<ElementKind >
kind of an element.
Note that it is possible additional element kinds will be added to accommodate new, currently unknown, language structures added to future versions of the Java™ programming language.
Element
| Enum Constant and Description |
|---|
ANNOTATION_TYPE
An annotation type.
|
CLASS
A class not described by a more specific kind (like
ENUM).
|
CONSTRUCTOR
A constructor.
|
ENUM
An enum type.
|
ENUM_CONSTANT
An enum constant.
|
EXCEPTION_PARAMETER
A parameter of an exception handler.
|
FIELD
A field not described by a more specific kind (like
ENUM_CONSTANT).
|
INSTANCE_INIT
An instance initializer.
|
INTERFACE
An interface not described by a more specific kind (like
ANNOTATION_TYPE).
|
LOCAL_VARIABLE
A local variable.
|
METHOD
A method.
|
OTHER
An implementation-reserved element.
|
PACKAGE
A package.
|
PARAMETER
A parameter of a method or constructor.
|
RESOURCE_VARIABLE
A resource variable.
|
STATIC_INIT
A static initializer.
|
TYPE_PARAMETER
A type parameter.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isClass()
Returns
true if this is a kind of class: either
CLASS or
ENUM.
|
boolean |
isField()
Returns
true if this is a kind of field: either
FIELD or
ENUM_CONSTANT.
|
boolean |
isInterface()
Returns
true if this is a kind of interface: either
INTERFACE or
ANNOTATION_TYPE.
|
static ElementKind |
valueOf(String
Returns the enum constant of this type with the specified name.
|
static ElementKind |
values()
Returns an array containing the constants of this enum type, in the order they are declared.
|
public static final ElementKindPACKAGE
public static final ElementKindENUM
public static final ElementKindCLASS
ENUM).
public static final ElementKindANNOTATION_TYPE
public static final ElementKindINTERFACE
ANNOTATION_TYPE).
public static final ElementKindENUM_CONSTANT
public static final ElementKindFIELD
ENUM_CONSTANT).
public static final ElementKindPARAMETER
public static final ElementKindLOCAL_VARIABLE
public static final ElementKindEXCEPTION_PARAMETER
public static final ElementKindMETHOD
public static final ElementKindCONSTRUCTOR
public static final ElementKindSTATIC_INIT
public static final ElementKindINSTANCE_INIT
public static final ElementKindTYPE_PARAMETER
public static final ElementKindOTHER
public static final ElementKindRESOURCE_VARIABLE
public static ElementKind[] values()
for (ElementKind c : ElementKind.values()) System.out.println(c);
public static ElementKindvalueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
public boolean isClass()
true if this is a kind of class: either
CLASS or
ENUM.
true if this is a kind of class
public boolean isInterface()
true if this is a kind of interface: either
INTERFACE or
ANNOTATION_TYPE.
true if this is a kind of interface
public boolean isField()
true if this is a kind of field: either
FIELD or
ENUM_CONSTANT.
true if this is a kind of field