Top Description Fields Constructors Methods
javax.lang.model.element

public final Enum ElementKind

extends Enum<ElementKind>
Class Inheritance

The 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.

Since
1.6
See Also
Element

Field Summary

Modifier and TypeField and Description
public static final ElementKind
ANNOTATION_TYPE

An annotation interface.

public static final ElementKind
BINDING_VARIABLE

A binding variable in a pattern.

public static final ElementKind
CLASS

A class not described by a more specific kind (like ENUM or RECORD).

public static final ElementKind
CONSTRUCTOR

A constructor.

public static final ElementKind
ENUM

An enum class.

public static final ElementKind
ENUM_CONSTANT

An enum constant.

public static final ElementKind
EXCEPTION_PARAMETER

A parameter of an exception handler.

public static final ElementKind
FIELD

A field not described by a more specific kind (like ENUM_CONSTANT).

public static final ElementKind
INSTANCE_INIT

An instance initializer.

public static final ElementKind
INTERFACE

An interface not described by a more specific kind (like ANNOTATION_TYPE).

public static final ElementKind
LOCAL_VARIABLE

A local variable.

public static final ElementKind
METHOD

A method.

public static final ElementKind
MODULE

A module.

public static final ElementKind
OTHER

An implementation-reserved element.

public static final ElementKind
PACKAGE

A package.

public static final ElementKind
PARAMETER

A parameter of a method or constructor.

public static final ElementKind
RECORD

A record class.

public static final ElementKind
RECORD_COMPONENT

A record component of a record.

public static final ElementKind
RESOURCE_VARIABLE

A resource variable.

public static final ElementKind
STATIC_INIT

A static initializer.

public static final ElementKind
TYPE_PARAMETER

A type parameter.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this is a kind of class
isClass
()

Returns true if this is a kind of class: either CLASS or ENUM or RECORD.

public boolean

Returns:

true if this is a kind of declared type, a class or an interface, and false otherwise
isDeclaredType
()

Returns true if this is a kind of declared type, a class or an interface, and false otherwise.

public boolean

Returns:

true if this is a kind of executable
isExecutable
()

Returns true if this is a kind of executable: either METHOD or CONSTRUCTOR or STATIC_INIT or INSTANCE_INIT.

public boolean

Returns:

true if this is a kind of field
isField
()

Returns true if this is a kind of field: either FIELD or ENUM_CONSTANT.

public boolean

Returns:

true if this is a kind of initializer
isInitializer
()

Returns true if this is a kind of initializer: either STATIC_INIT or INSTANCE_INIT.

public boolean

Returns:

true if this is a kind of interface
isInterface
()

Returns true if this is a kind of interface: either INTERFACE or ANNOTATION_TYPE.

public boolean

Returns:

true if this is a kind of variable
isVariable
()

Returns true if this is a kind of variable: including ENUM_CONSTANT, FIELD, PARAMETER, LOCAL_VARIABLE, EXCEPTION_PARAMETER, RESOURCE_VARIABLE, and BINDING_VARIABLE.

public static ElementKind
public static ElementKind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ANNOTATION_TYPEback to summary
public static final ElementKind ANNOTATION_TYPE

An annotation interface. (Formerly known as an annotation type.)

BINDING_VARIABLEback to summary
public static final ElementKind BINDING_VARIABLE

A binding variable in a pattern.

Since
16
CLASSback to summary
public static final ElementKind CLASS

A class not described by a more specific kind (like ENUM or RECORD).

CONSTRUCTORback to summary
public static final ElementKind CONSTRUCTOR

A constructor.

ENUMback to summary
public static final ElementKind ENUM

An enum class.

ENUM_CONSTANTback to summary
public static final ElementKind ENUM_CONSTANT

An enum constant.

EXCEPTION_PARAMETERback to summary
public static final ElementKind EXCEPTION_PARAMETER

A parameter of an exception handler.

FIELDback to summary
public static final ElementKind FIELD

A field not described by a more specific kind (like ENUM_CONSTANT).

INSTANCE_INITback to summary
public static final ElementKind INSTANCE_INIT

An instance initializer.

INTERFACEback to summary
public static final ElementKind INTERFACE

An interface not described by a more specific kind (like ANNOTATION_TYPE).

LOCAL_VARIABLEback to summary
public static final ElementKind LOCAL_VARIABLE

A local variable.

METHODback to summary
public static final ElementKind METHOD

A method.

MODULEback to summary
public static final ElementKind MODULE

A module.

Since
9
OTHERback to summary
public static final ElementKind OTHER

An implementation-reserved element. This is not the element you are looking for.

PACKAGEback to summary
public static final ElementKind PACKAGE

A package.

PARAMETERback to summary
public static final ElementKind PARAMETER

A parameter of a method or constructor.

RECORDback to summary
public static final ElementKind RECORD

A record class.

Since
16
RECORD_COMPONENTback to summary
public static final ElementKind RECORD_COMPONENT

A record component of a record.

Since
16
RESOURCE_VARIABLEback to summary
public static final ElementKind RESOURCE_VARIABLE

A resource variable.

Since
1.7
STATIC_INITback to summary
public static final ElementKind STATIC_INIT

A static initializer.

TYPE_PARAMETERback to summary
public static final ElementKind TYPE_PARAMETER

A type parameter.

Constructor Detail

ElementKindback to summary
private ElementKind()

Method Detail

isClassback to summary
public boolean isClass()

Returns true if this is a kind of class: either CLASS or ENUM or RECORD.

Returns:boolean

true if this is a kind of class

isDeclaredTypeback to summary
public boolean isDeclaredType()

Returns true if this is a kind of declared type, a class or an interface, and false otherwise.

Returns:boolean

true if this is a kind of declared type, a class or an interface, and false otherwise

Since
19
isExecutableback to summary
public boolean isExecutable()

Returns true if this is a kind of executable: either METHOD or CONSTRUCTOR or STATIC_INIT or INSTANCE_INIT.

Returns:boolean

true if this is a kind of executable

Since
19
isFieldback to summary
public boolean isField()

Returns true if this is a kind of field: either FIELD or ENUM_CONSTANT.

Returns:boolean

true if this is a kind of field

isInitializerback to summary
public boolean isInitializer()

Returns true if this is a kind of initializer: either STATIC_INIT or INSTANCE_INIT.

Returns:boolean

true if this is a kind of initializer

Since
19
isInterfaceback to summary
public boolean isInterface()

Returns true if this is a kind of interface: either INTERFACE or ANNOTATION_TYPE.

Returns:boolean

true if this is a kind of interface

isVariableback to summary
public boolean isVariable()

Returns true if this is a kind of variable: including ENUM_CONSTANT, FIELD, PARAMETER, LOCAL_VARIABLE, EXCEPTION_PARAMETER, RESOURCE_VARIABLE, and BINDING_VARIABLE.

Returns:boolean

true if this is a kind of variable

Since
19
valueOfback to summary
public static ElementKind valueOf(String name)
valuesback to summary
public static ElementKind[] values()