private static boolean checkAnnoExist ( Object targetClass , Class < ? > annoClass ) { Annotation [ ] anno = getAnnotations ( targetClass ) ; for ( Annotation annotation : anno ) { Class < ? extends Annotation > type = annotation . annotationType ( ) ; if ( annoClass . equals ( type ) ) return true ; } return false ; }
Check if annotation exist in Class or Field