Name

Target

Synopsis

A meta-annotation of this type specifies what program elements the annotated annotation type can be applied to. The value( ) of a Target annotation is an array of ElementType enumerated constants. See ElementType for details on the allowed values. If an annotation type does not have an @Target meta-annotation, it can be applied to any program element.

java.lang.annotation.Target

Figure 10-82. java.lang.annotation.Target

public @interface Target {
// Public Instance Methods
     ElementType[ ] value( );  
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.