spring 获取对象的注解

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

猜你喜欢

转载自www.cnblogs.com/xiluhua/p/9461017.html