Class AnnotationLiteral<T extends Annotation>

java.lang.Object
org.glassfish.hk2.api.AnnotationLiteral<T>
Type Parameters:
T - the annotation type
All Implemented Interfaces:
Serializable, Annotation
Direct Known Subclasses:
NamedImpl, RunLevelServiceUtilities.RunLevelImpl, ServiceLocatorUtilities.ImmediateImpl, ServiceLocatorUtilities.InheritableThreadImpl, ServiceLocatorUtilities.PerLookupImpl, ServiceLocatorUtilities.PerThreadImpl, ServiceLocatorUtilities.SingletonImpl, UnqualifiedImpl

public abstract class AnnotationLiteral<T extends Annotation> extends Object implements Annotation, 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:

  1. Must have the target annotation as its generic type
  2. Must implement the target type

In particular, in-line anonymous extensions of AnnotationLiteral will not work because in-line anonymous extensions of AnnotationLiteral cannot implement the target annotation
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For serialization
      See Also:
    • annotationType

      private transient Class<T extends Annotation> annotationType
    • members

      private transient Method[] members
  • Constructor Details

    • AnnotationLiteral

      protected AnnotationLiteral()
  • Method Details