spring 获取对象的注解

 

 

BeanDefinition definition = registry.getBeanDefinition(name);
if (definition instanceof AnnotatedBeanDefinition) {
  AnnotatedBeanDefinition annotatedDefinition = (AnnotatedBeanDefinition) definition;
  addComponentScanningPackages(packages, annotatedDefinition.getMetadata());
}

 

posted @ 2018-08-11 20:42  xiluhua  阅读(1388)  评论(0编辑  收藏  举报