@ Nullable static AnnotationMirror getAnnotationWithSimpleName ( Element element , String name ) { for ( AnnotationMirror mirror : element . getAnnotationMirrors ( ) ) { String annotationName = mirror . getAnnotationType ( ) . asElement ( ) . getSimpleName ( ) . toString ( ) ; if ( name . equals ( annotationName ) ) { return mirror ; } } return null ; }
Finds an annotation with the given name on the given element or null if not found .