Spring里的applicationContext.getBeansWithAnnotation

getBeansWithAnnotation


Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
throws BeansException


Find all beans whose Class has the supplied Annotation type.


Parameters:
annotationType - the type of annotation to look for
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created

文章来自:https://www.cnblogs.com/yuyu666/p/10071829.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3