public static boolean hasAnnotation ( CtClass clazz , String annotationName ) { ClassFile cf = clazz . getClassFile2 ( ) ; AnnotationsAttribute ainfo = ( AnnotationsAttribute ) cf . getAttribute ( AnnotationsAttribute . invisibleTag ) ; AnnotationsAttribute ainfo2 = ( AnnotationsAttribute ) cf . getAttribute ( AnnotationsAttribute . visibleTag ) ; return checkAnnotation ( ainfo , ainfo2 , annotationName ) ; }
Returns true if the given class has an annotation set with the given name returns false otherwise .