|
22 | 22 | import java.lang.annotation.RetentionPolicy;
|
23 | 23 | import java.lang.annotation.Target;
|
24 | 24 |
|
| 25 | +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; |
25 | 26 | import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
26 | 27 | import org.springframework.core.annotation.AliasFor;
|
27 | 28 |
|
|
202 | 203 | * @author Chris Beams
|
203 | 204 | * @author Juergen Hoeller
|
204 | 205 | * @author Sam Brannen
|
| 206 | + * @author Yanming Zhou |
205 | 207 | * @since 3.0
|
206 | 208 | * @see Configuration
|
207 | 209 | * @see Scope
|
|
242 | 244 | * Is this bean a candidate for getting autowired into some other bean at all?
|
243 | 245 | * <p>Default is {@code true}; set this to {@code false} for internal delegates
|
244 | 246 | * that are not meant to get in the way of beans of the same type in other places.
|
| 247 | + * <p>NOTE: if this is set to {@code false}, bean is excluded when autowiring |
| 248 | + * arrays, collections, maps, or ObjectProvider streams, use |
| 249 | + * {@link ConfigurableListableBeanFactory#getBeansOfType(Class)} |
| 250 | + * if you want to get all beans of the same type. |
245 | 251 | * @since 5.1
|
246 | 252 | * @see #defaultCandidate()
|
247 | 253 | */
|
|
253 | 259 | * <p>Default is {@code true}; set this to {@code false} for restricted delegates
|
254 | 260 | * that are supposed to be injectable in certain areas but are not meant to get
|
255 | 261 | * in the way of beans of the same type in other places.
|
| 262 | + * <p>NOTE: if this is set to {@code false}, bean is excluded when autowiring |
| 263 | + * arrays, collections, maps, or ObjectProvider streams, use |
| 264 | + * {@link ConfigurableListableBeanFactory#getBeansOfType(Class)} |
| 265 | + * if you want to get all beans of the same type. |
256 | 266 | * <p>This is a variation of {@link #autowireCandidate()} which does not disable
|
257 | 267 | * injection in general, just enforces an additional indication such as a qualifier.
|
258 | 268 | * @since 6.2
|
|
0 commit comments