Clarify primary/fallback autowiring for arrays/collections/maps
Closes gh-32301
This commit is contained in:
@@ -29,6 +29,11 @@ import java.lang.annotation.Target;
|
||||
* <p>If all beans but one among multiple matching candidates are marked
|
||||
* as a fallback, the remaining bean will be selected.
|
||||
*
|
||||
* <p>Just like primary beans, fallback beans only have an effect when
|
||||
* finding multiple candidates for single injection points.
|
||||
* All type-matching beans are included when autowiring arrays,
|
||||
* collections, maps, or ObjectProvider streams.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 6.2
|
||||
* @see Primary
|
||||
|
||||
@@ -27,6 +27,10 @@ import java.lang.annotation.Target;
|
||||
* are qualified to autowire a single-valued dependency. If exactly one
|
||||
* 'primary' bean exists among the candidates, it will be the autowired value.
|
||||
*
|
||||
* <p>Primary beans only have an effect when finding multiple candidates
|
||||
* for single injection points. All type-matching beans are included when
|
||||
* autowiring arrays, collections, maps, or ObjectProvider streams.
|
||||
*
|
||||
* <p>This annotation is semantically equivalent to the {@code <bean>} element's
|
||||
* {@code primary} attribute in Spring XML.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user