@ SuppressWarnings ( "unchecked" ) public < T extends Annotation > T getAnnotation ( Class < T > annotationType ) { for ( Annotation annotation : this . annotations ) { if ( annotation . annotationType ( ) . equals ( annotationType ) ) { return ( T ) annotation ; } } for ( Annotation metaAnn : this . annotations ) { T ann = metaAnn . annotationType ( ) . getAnnotation ( annotationType ) ; if ( ann != null ) { return ann ; } } return null ; }
Obtain the annotation associated with this type descriptor of the specified type .