Class AnnotationLiteral<T extends java.lang.annotation.Annotation>
- java.lang.Object
-
- org.glassfish.jersey.internal.inject.AnnotationLiteral<T>
-
- Type Parameters:
T
- the annotation type
- All Implemented Interfaces:
java.io.Serializable
,java.lang.annotation.Annotation
- Direct Known Subclasses:
BackgroundSchedulerLiteral
,ClientAsyncExecutorLiteral
,ClientBackgroundSchedulerLiteral
,CustomAnnotationLiteral
,ManagedAsyncExecutorLiteral
,SecurityAnnotations.DenyAllImpl
,SecurityAnnotations.PermitAllImpl
,SecurityAnnotations.RolesAllowedImpl
public abstract class AnnotationLiteral<T extends java.lang.annotation.Annotation> extends java.lang.Object implements java.lang.annotation.Annotation, java.io.Serializable
Supports inline instantiation of annotation type instances.An instance of an annotation type may be obtained by subclassing AnnotationLiteral.
public abstract class PayByQualifier extends AnnotationLiteral<PayBy> implements PayBy {}
An extension of AnnotationLiteral must do two things:- Must have the target annotation as its generic type
- Must implement the target type
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<T>
annotationType
private java.lang.reflect.Method[]
members
private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protected
AnnotationLiteral()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends java.lang.annotation.Annotation>
annotationType()
Method returns the type of the annotation literal.boolean
equals(java.lang.Object other)
private static java.lang.Class<?>
getAnnotationLiteralSubclass(java.lang.Class<?> clazz)
private java.lang.reflect.Method[]
getMembers()
private static <T> java.lang.Class<T>
getTypeParameter(java.lang.Class<?> annotationLiteralSuperclass)
int
hashCode()
private static java.lang.Object
invoke(java.lang.reflect.Method method, java.lang.Object instance)
private static void
setAccessible(java.lang.reflect.AccessibleObject ao)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
annotationType
private transient java.lang.Class<T extends java.lang.annotation.Annotation> annotationType
-
members
private transient java.lang.reflect.Method[] members
-
-
Method Detail
-
getAnnotationLiteralSubclass
private static java.lang.Class<?> getAnnotationLiteralSubclass(java.lang.Class<?> clazz)
-
getTypeParameter
private static <T> java.lang.Class<T> getTypeParameter(java.lang.Class<?> annotationLiteralSuperclass)
-
setAccessible
private static void setAccessible(java.lang.reflect.AccessibleObject ao)
-
invoke
private static java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object instance)
-
getMembers
private java.lang.reflect.Method[] getMembers()
-
annotationType
public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
Method returns the type of the annotation literal. The value is resolved lazily during the first call of this method.- Specified by:
annotationType
in interfacejava.lang.annotation.Annotation
- Returns:
- annotation type of this literal.
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equals
in interfacejava.lang.annotation.Annotation
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.lang.annotation.Annotation
- Overrides:
hashCode
in classjava.lang.Object
-
-