Class AnnotationType
java.lang.Object
com.strobel.reflection.emit.AnnotationType
Represents an annotation type at run time. Used to type-check annotations
and apply member defaults.
- Since:
- 1.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ClassValue<AnnotationType> private final booleanWhether this annotation type is inherited.Member name -> default value mapping.Member name -> Method object mapping.Member name -> type mapping.private final RetentionPolicyThe retention policy for this annotation type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateAnnotationType(Class<? extends Annotation> annotationClass) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationTypegetInstance(Class<? extends Annotation> annotationClass) Returns an AnnotationType instance for the specified annotation type.static Class<?> invocationHandlerReturnType(Class<?> type) 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).booleanReturns true if this annotation type is inherited.Returns the default values for this annotation type (Member name -> default value mapping).members()Returns members of this annotation type (member name -> associated Method object mapping).Returns member types for this annotation type (member name -> type mapping).Returns the retention policy for this annotation type.toString()For debugging.
-
Field Details
-
ANNOTATION_TYPES
-
memberTypes
-
memberDefaults
-
members
-
retention
The retention policy for this annotation type. -
inherited
private final boolean inheritedWhether this annotation type is inherited.
-
-
Constructor Details
-
AnnotationType
Sole constructor.- Parameters:
annotationClass- the class object for the annotation type- Throws:
IllegalArgumentException- if the specified class object for does not represent a valid annotation type
-
-
Method Details
-
getInstance
Returns an AnnotationType instance for the specified annotation type.- Throws:
IllegalArgumentException- if the specified class object for does not represent a valid annotation type
-
invocationHandlerReturnType
-
memberTypes
-
members
-
memberDefaults
-
retention
Returns the retention policy for this annotation type. -
isInherited
public boolean isInherited()Returns true if this annotation type is inherited. -
toString
-