public static List < Method > getAnnotatedMethods ( Class targetClass , Class < ? extends Annotation > annotationType ) { List < Method > annotatedMethods = new ArrayList < Method > ( ) ; for ( Method method : targetClass . getDeclaredMethods ( ) ) { if ( method . isAnnotationPresent ( annotationType ) ) { annotatedMethods . add ( method ) ; } } return annotatedMethods ; }
Get all methods on the given class that are annotated with the given annotation type .