Spring自定义注解,获取添加自定义注解的所有类

1.获取所有指定注解的类的bean信息

Map<String, Object> beansWithAnnotationMap = this.applicationContext.getBeansWithAnnotation(RespMegTypeSup.class);

String[] beanNames = this.applicationContext.getBeanNamesForAnnotation(RespMegTypeSup.class);

 

posted @ 2021-12-30 11:38  N神3  阅读(1227)  评论(0编辑  收藏  举报