Class AnnotationDescriptor<A extends Annotation>

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    ConstraintAnnotationDescriptor

    public class AnnotationDescriptor<A extends Annotation>
    extends Object
    implements Serializable
    Encapsulates the data you need to create an annotation. In particular, it stores the type of an Annotation instance and the values of its elements. The "elements" we're talking about are the annotation attributes, not its targets (the term "element" is used ambiguously in Java's annotations documentation).
    Author:
    Paolo Perrotta, Davide Marchignoli, Hardy Ferentschik, Gunnar Morling, Guillaume Smet
    See Also:
    Serialized Form
    • Constructor Detail

      • AnnotationDescriptor

        public AnnotationDescriptor​(A annotation)
    • Method Detail

      • getType

        public Class<A> getType()
      • getMandatoryAttribute

        public <T> T getMandatoryAttribute​(String attributeName,
                                           Class<T> attributeType)
      • getAttribute

        public <T> T getAttribute​(String attributeName,
                                  Class<T> attributeType)
      • getAttribute

        public Object getAttribute​(String attributeName)
      • getAnnotation

        public A getAnnotation()