public static < T extends Annotation > T findAnnotation ( Class < ? > type , Annotation [ ] annotations , Class < T > annotation ) { T config = FindAnnotation . findAnnotation ( annotations , annotation ) ; if ( config == null ) { config = type . getAnnotation ( annotation ) ; } return config ; }
Look for an annotation in a list of annotations . If not there see if it is on the type provided