|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2018 the original author or authors. |
|
|
|
|
* Copyright 2002-2019 the original author or authors. |
|
|
|
|
* |
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -243,18 +243,19 @@ public interface ListableBeanFactory extends BeanFactory {
@@ -243,18 +243,19 @@ public interface ListableBeanFactory extends BeanFactory {
|
|
|
|
|
throws BeansException; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Find all names of beans whose {@code Class} has the supplied {@link Annotation} |
|
|
|
|
* Find all names of beans which are annotated with the supplied {@link Annotation} |
|
|
|
|
* type, without creating corresponding bean instances yet. |
|
|
|
|
* <p>Note that this method considers objects created by FactoryBeans, which means |
|
|
|
|
* that FactoryBeans will get initialized in order to determine their object type. |
|
|
|
|
* @param annotationType the type of annotation to look for |
|
|
|
|
* @return the names of all matching beans |
|
|
|
|
* @since 4.0 |
|
|
|
|
* @see #findAnnotationOnBean |
|
|
|
|
*/ |
|
|
|
|
String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotationType); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Find all beans whose {@code Class} has the supplied {@link Annotation} type, |
|
|
|
|
* Find all beans which are annotated with the supplied {@link Annotation} type, |
|
|
|
|
* returning a Map of bean names with corresponding bean instances. |
|
|
|
|
* <p>Note that this method considers objects created by FactoryBeans, which means |
|
|
|
|
* that FactoryBeans will get initialized in order to determine their object type. |
|
|
|
@ -263,18 +264,21 @@ public interface ListableBeanFactory extends BeanFactory {
@@ -263,18 +264,21 @@ public interface ListableBeanFactory extends BeanFactory {
|
|
|
|
|
* keys and the corresponding bean instances as values |
|
|
|
|
* @throws BeansException if a bean could not be created |
|
|
|
|
* @since 3.0 |
|
|
|
|
* @see #findAnnotationOnBean |
|
|
|
|
*/ |
|
|
|
|
Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType) throws BeansException; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Find an {@link Annotation} of {@code annotationType} on the specified |
|
|
|
|
* bean, traversing its interfaces and super classes if no annotation can be |
|
|
|
|
* found on the given class itself. |
|
|
|
|
* Find an {@link Annotation} of {@code annotationType} on the specified bean, |
|
|
|
|
* traversing its interfaces and super classes if no annotation can be found on |
|
|
|
|
* the given class itself. |
|
|
|
|
* @param beanName the name of the bean to look for annotations on |
|
|
|
|
* @param annotationType the annotation class to look for |
|
|
|
|
* @param annotationType the type of annotation to look for |
|
|
|
|
* @return the annotation of the given type if found, or {@code null} otherwise |
|
|
|
|
* @throws NoSuchBeanDefinitionException if there is no bean with the given name |
|
|
|
|
* @since 3.0 |
|
|
|
|
* @see #getBeanNamesForAnnotation |
|
|
|
|
* @see #getBeansWithAnnotation |
|
|
|
|
*/ |
|
|
|
|
@Nullable |
|
|
|
|
<A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) |
|
|
|
|