package sun.reflect.annotation;
Represents an annotation type at run time. Used to type-check annotations
and apply member defaults.
- Author(s):
- Josh Bloch
- Since:
- 1.5
Member name -> type mapping. Note that primitive types
are represented by the class objects for the corresponding wrapper
types. This matches the return value that must be used for a
dynamic proxy, allowing for a simple isInstance test.
Member name -> default value mapping.
Member name -> Method object mapping. This (and its assoicated
accessor) are used only to generate AnnotationTypeMismatchExceptions.
The retention policy for this annotation type.
Whether this annotation type is inherited.
Returns an AnnotationType instance for the specified annotation type.
- Throw:
- IllegalArgumentException if the specified class object for
does not represent a valid annotation type
Sole constructor.
- Parameters:
annotationClass the class object for the annotation type- Throw:
- IllegalArgumentException if the specified class object for
does not represent a valid annotation type
for (Method method : methods) { if (defaultValue != null)
Returns the type that must be returned by the invocation handler
of a dynamic proxy in order to have the dynamic proxy return
the specified type (which is assumed to be a legal member type
for an annotation).
if (type == double.class)
if (type == boolean.class)
Returns member types for this annotation type
(member name -> type mapping).
Returns members of this annotation type
(member name -> associated Method object mapping).
Returns the default values for this annotation type
(Member name -> default value mapping).
Returns the retention policy for this annotation type.
Returns true if this this annotation type is inherited.