public static Map < String , Object > getBeansWithAnnotation ( ApplicationContext appContext , Class < ? extends Annotation > annotationType ) { try { return appContext . getBeansWithAnnotation ( annotationType ) ; } catch ( BeansException e ) { return new HashMap < String , Object > ( ) ; } }
Gets all beans whose Class has the supplied Annotation type .