public static boolean hasNamedAnnotation(AnnotatedConstruct ac, Pattern pattern) {
    for (AnnotationMirror annotation : ac.getAnnotationMirrors()) {
      if (pattern.matcher(getName(annotation.getAnnotationType().asElement())).matches()) {
        return true;
      }
    }
    return false;
  }
public static boolean hasNamedAnnotation ( AnnotatedConstruct ac , Pattern pattern ) { for ( AnnotationMirror annotation : ac . getAnnotationMirrors ( ) ) { if ( pattern . matcher ( getName ( annotation . getAnnotationType ( ) . asElement ( ) ) ) . matches ( ) ) { return true ; } } return false ; }
Similar to the above but matches against a pattern.