java.lang.annotation
Enum ElementType

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.lang.Enum sample code for java.lang.Enum definition code for java.lang.Enum <ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType >
      extended by java.lang.annotation.ElementType
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Comparable sample code for java.lang.Comparable definition code for java.lang.Comparable <ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType >

public enum ElementType
extends Enum sample code for java.lang.Enum definition code for java.lang.Enum <ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType >

A program element type. The constants of this enumerated type provide a simple classification of the declared elements in a Java program.

These constants are used with the Target meta-annotation type to specify where it is legal to use an annotation type.

Since:
1.5

Enum Constant Summary
ANNOTATION_TYPE sample code for java.lang.annotation.ElementType.ANNOTATION_TYPE definition code for java.lang.annotation.ElementType.ANNOTATION_TYPE
          Annotation type declaration
CONSTRUCTOR sample code for java.lang.annotation.ElementType.CONSTRUCTOR definition code for java.lang.annotation.ElementType.CONSTRUCTOR
          Constructor declaration
FIELD sample code for java.lang.annotation.ElementType.FIELD definition code for java.lang.annotation.ElementType.FIELD
          Field declaration (inlcudes enum constants)
LOCAL_VARIABLE sample code for java.lang.annotation.ElementType.LOCAL_VARIABLE definition code for java.lang.annotation.ElementType.LOCAL_VARIABLE
          Local variable declaration
METHOD sample code for java.lang.annotation.ElementType.METHOD definition code for java.lang.annotation.ElementType.METHOD
          Method declaration
PACKAGE sample code for java.lang.annotation.ElementType.PACKAGE definition code for java.lang.annotation.ElementType.PACKAGE
          Package declaration
PARAMETER sample code for java.lang.annotation.ElementType.PARAMETER definition code for java.lang.annotation.ElementType.PARAMETER
          Parameter declaration
TYPE sample code for java.lang.annotation.ElementType.TYPE definition code for java.lang.annotation.ElementType.TYPE
          Class, interface (including annotation type), or enum declaration
 
Method Summary
static ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType valueOf sample code for java.lang.annotation.ElementType.valueOf(java.lang.String) definition code for java.lang.annotation.ElementType.valueOf(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Returns the enum constant of this type with the specified name.
static ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType [] values sample code for java.lang.annotation.ElementType.values() definition code for java.lang.annotation.ElementType.values() ()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum sample code for java.lang.Enum definition code for java.lang.Enum
clone sample code for java.lang.Enum.clone() definition code for java.lang.Enum.clone() , compareTo sample code for java.lang.Enum.compareTo(E) definition code for java.lang.Enum.compareTo(E) , equals sample code for java.lang.Enum.equals(java.lang.Object) definition code for java.lang.Enum.equals(java.lang.Object) , getDeclaringClass sample code for java.lang.Enum.getDeclaringClass() definition code for java.lang.Enum.getDeclaringClass() , hashCode sample code for java.lang.Enum.hashCode() definition code for java.lang.Enum.hashCode() , name sample code for java.lang.Enum.name() definition code for java.lang.Enum.name() , ordinal sample code for java.lang.Enum.ordinal() definition code for java.lang.Enum.ordinal() , toString sample code for java.lang.Enum.toString() definition code for java.lang.Enum.toString() , valueOf sample code for java.lang.Enum.valueOf(java.lang.Class, java.lang.String) definition code for java.lang.Enum.valueOf(java.lang.Class, java.lang.String)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Enum Constant Detail

TYPE

public static final ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType  TYPE
Class, interface (including annotation type), or enum declaration


FIELD

public static final ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType  FIELD
Field declaration (inlcudes enum constants)


METHOD

public static final ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType  METHOD
Method declaration


PARAMETER

public static final ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType  PARAMETER
Parameter declaration


CONSTRUCTOR

public static final ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType  CONSTRUCTOR
Constructor declaration


LOCAL_VARIABLE

public static final ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType  LOCAL_VARIABLE
Local variable declaration


ANNOTATION_TYPE

public static final ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType  ANNOTATION_TYPE
Annotation type declaration


PACKAGE

public static final ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType  PACKAGE
Package declaration

Method Detail

values sample code for java.lang.annotation.ElementType.values() definition code for java.lang.annotation.ElementType.values()

public static final ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType [] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(ElementType c : ElementType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf sample code for java.lang.annotation.ElementType.valueOf(java.lang.String) definition code for java.lang.annotation.ElementType.valueOf(java.lang.String)

public static ElementType sample code for java.lang.annotation.ElementType definition code for java.lang.annotation.ElementType  valueOf(String sample code for java.lang.String definition code for java.lang.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 sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if this enum type has no constant with the specified name