|
|
|
@ -83,6 +83,7 @@ public class AnnotatedBeanDefinitionReader { |
|
|
|
AnnotationConfigUtils.registerAnnotationConfigProcessors(this.registry); |
|
|
|
AnnotationConfigUtils.registerAnnotationConfigProcessors(this.registry); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Return the BeanDefinitionRegistry that this scanner operates on. |
|
|
|
* Return the BeanDefinitionRegistry that this scanner operates on. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -117,21 +118,50 @@ public class AnnotatedBeanDefinitionReader { |
|
|
|
(scopeMetadataResolver != null ? scopeMetadataResolver : new AnnotationScopeMetadataResolver()); |
|
|
|
(scopeMetadataResolver != null ? scopeMetadataResolver : new AnnotationScopeMetadataResolver()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Register one or more annotated classes to be processed. |
|
|
|
|
|
|
|
* <p>Calls to {@code register} are idempotent; adding the same |
|
|
|
|
|
|
|
* annotated class more than once has no additional effect. |
|
|
|
|
|
|
|
* @param annotatedClasses one or more annotated classes, |
|
|
|
|
|
|
|
* e.g. {@link Configuration @Configuration} classes |
|
|
|
|
|
|
|
*/ |
|
|
|
public void register(Class<?>... annotatedClasses) { |
|
|
|
public void register(Class<?>... annotatedClasses) { |
|
|
|
for (Class<?> annotatedClass : annotatedClasses) { |
|
|
|
for (Class<?> annotatedClass : annotatedClasses) { |
|
|
|
registerBean(annotatedClass); |
|
|
|
registerBean(annotatedClass); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Register a bean from the given bean class, deriving its metadata from |
|
|
|
|
|
|
|
* class-declared annotations. |
|
|
|
|
|
|
|
* @param annotatedClass the class of the bean |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
public void registerBean(Class<?> annotatedClass) { |
|
|
|
public void registerBean(Class<?> annotatedClass) { |
|
|
|
registerBean(annotatedClass, null, (Class<? extends Annotation>[]) null); |
|
|
|
registerBean(annotatedClass, null, (Class<? extends Annotation>[]) null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Register a bean from the given bean class, deriving its metadata from |
|
|
|
|
|
|
|
* class-declared annotations. |
|
|
|
|
|
|
|
* @param annotatedClass the class of the bean |
|
|
|
|
|
|
|
* @param qualifiers specific qualifier annotations to consider, |
|
|
|
|
|
|
|
* in addition to qualifiers at the bean class level |
|
|
|
|
|
|
|
*/ |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
public void registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers) { |
|
|
|
public void registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers) { |
|
|
|
registerBean(annotatedClass, null, qualifiers); |
|
|
|
registerBean(annotatedClass, null, qualifiers); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Register a bean from the given bean class, deriving its metadata from |
|
|
|
|
|
|
|
* class-declared annotations. |
|
|
|
|
|
|
|
* @param annotatedClass the class of the bean |
|
|
|
|
|
|
|
* @param name an explicit name for the bean |
|
|
|
|
|
|
|
* @param qualifiers specific qualifier annotations to consider, |
|
|
|
|
|
|
|
* in addition to qualifiers at the bean class level |
|
|
|
|
|
|
|
*/ |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
public void registerBean(Class<?> annotatedClass, String name, Class<? extends Annotation>... qualifiers) { |
|
|
|
public void registerBean(Class<?> annotatedClass, String name, Class<? extends Annotation>... qualifiers) { |
|
|
|
AnnotatedGenericBeanDefinition abd = new AnnotatedGenericBeanDefinition(annotatedClass); |
|
|
|
AnnotatedGenericBeanDefinition abd = new AnnotatedGenericBeanDefinition(annotatedClass); |
|
|
|
|