JavaTM 2 Platform
Standard Ed. 5.0

Uses of Interface
java.lang.annotation.Annotation

Packages that use Annotation
java.lang Provides classes that are fundamental to the design of the Java programming language. 
java.lang.annotation Provides library support for the Java programming language annotation facility. 
java.lang.reflect Provides classes and interfaces for obtaining reflective information about classes and objects. 
 

Uses of Annotation in java.lang
 

Classes in java.lang that implement Annotation
 interface Deprecated
          A program element annotated @Deprecated is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists.
 interface Override
          Indicates that a method declaration is intended to override a method declaration in a superclass.
 interface SuppressWarnings
          Indicates that the named compiler warnings should be suppressed in the annotated element (and in all program elements contained in the annotated element).
 

Methods in java.lang with type parameters of type Annotation
<A extends Annotation>
A
Package.getAnnotation(Class<A> annotationClass)
           
<A extends Annotation>
A
Class.getAnnotation(Class<A> annotationClass)
          Returns this element's annotation for the specified type if such an annotation is present, else null.
 

Methods in java.lang that return Annotation
 Annotation[] Package.getAnnotations()
           
 Annotation[] Class.getAnnotations()
          Returns all annotations present on this element.
 Annotation[] Package.getDeclaredAnnotations()
           
 Annotation[] Class.getDeclaredAnnotations()
          Returns all annotations that are directly present on this element.
 

Method parameters in java.lang with type arguments of type Annotation
 boolean Package.isAnnotationPresent(Class<? extends Annotation> annotationClass)
           
 boolean Class.isAnnotationPresent(Class<? extends Annotation> annotationClass)
          Returns true if an annotation for the specified type is present on this element, else false.
 

Uses of Annotation in java.lang.annotation
 

Classes in java.lang.annotation that implement Annotation
 interface Documented
          Indicates that annotations with a type are to be documented by javadoc and similar tools by default.
 interface Inherited
          Indicates that an annotation type is automatically inherited.
 interface Retention
          Indicates how long annotations with the annotated type are to be retained.
 interface Target
          Indicates the kinds of program element to which an annotation type is applicable.
 

Methods in java.lang.annotation that return types with arguments of type Annotation
 Class<? extends Annotation> IncompleteAnnotationException.annotationType()
          Returns the Class object for the annotation type with the missing element.
 Class<? extends Annotation> Annotation.annotationType()
          Returns the annotation type of this annotation.
 

Constructor parameters in java.lang.annotation with type arguments of type Annotation
IncompleteAnnotationException(Class<? extends Annotation> annotationType, String elementName)
          Constructs an IncompleteAnnotationException to indicate that the named element was missing from the specified annotation type.
 

Uses of Annotation in java.lang.reflect
 

Methods in java.lang.reflect with type parameters of type Annotation
<T extends Annotation>
T
Field.getAnnotation(Class<T> annotationClass)
           
<T extends Annotation>
T
Method.getAnnotation(Class<T> annotationClass)
           
<T extends Annotation>
T
AccessibleObject.getAnnotation(Class<T> annotationClass)
           
<T extends Annotation>
T
Constructor.getAnnotation(Class<T> annotationClass)
           
<T extends Annotation>
T
AnnotatedElement.getAnnotation(Class<T> annotationType)
          Returns this element's annotation for the specified type if such an annotation is present, else null.
 

Methods in java.lang.reflect that return Annotation
 Annotation[] AccessibleObject.getAnnotations()
           
 Annotation[] AnnotatedElement.getAnnotations()
          Returns all annotations present on this element.
 Annotation[] Field.getDeclaredAnnotations()
           
 Annotation[] Method.getDeclaredAnnotations()
           
 Annotation[] AccessibleObject.getDeclaredAnnotations()
           
 Annotation[] Constructor.getDeclaredAnnotations()
           
 Annotation[] AnnotatedElement.getDeclaredAnnotations()
          Returns all annotations that are directly present on this element.
 Annotation[][] Method.getParameterAnnotations()
          Returns an array of arrays that represent the annotations on the formal parameters, in declaration order, of the method represented by this Method object.
 Annotation[][] Constructor.getParameterAnnotations()
          Returns an array of arrays that represent the annotations on the formal parameters, in declaration order, of the method represented by this Method object.
 

Method parameters in java.lang.reflect with type arguments of type Annotation
 boolean AccessibleObject.isAnnotationPresent(Class<? extends Annotation> annotationClass)
           
 boolean AnnotatedElement.isAnnotationPresent(Class<? extends Annotation> annotationType)
          Returns true if an annotation for the specified type is present on this element, else false.
 


JavaTM 2 Platform
Standard Ed. 5.0

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.