Interface AnnotationSource

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean hasAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
      Returns true if the property has the specified annotation.
      <A extends java.lang.annotation.Annotation>
      A
      readAnnotation​(java.lang.Class<A> annotationType)
      Gets the value of the specified annotation from the given property.
    • Method Detail

      • readAnnotation

        <A extends java.lang.annotation.Annotation> A readAnnotation​(java.lang.Class<A> annotationType)
        Gets the value of the specified annotation from the given property.

        When this method is used for a property that consists of a getter and setter, it returns the annotation on either of those methods. If both methods have the same annotation, it is an error.

        Returns:
        null if the annotation is not present.
      • hasAnnotation

        boolean hasAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
        Returns true if the property has the specified annotation.

        Short for readAnnotation(annotationType)!=null, but this method is typically faster.