|
46 | 46 | * <h3>Bean Names</h3> |
47 | 47 | * |
48 | 48 | * <p>While a {@link #name} attribute is available, the default strategy for |
49 | | - * determining the name of a bean is to use the name of the {@code @Bean} method. This |
50 | | - * is convenient and intuitive, but if explicit naming is desired, the {@code name} |
51 | | - * attribute (or its alias {@code value}) may be used. Also note that {@code name} |
52 | | - * accepts an array of Strings. This is in order to allow for specifying multiple names |
53 | | - * (i.e., aliases) for a single bean. |
| 49 | + * determining the name of a bean is to use the name of the {@code @Bean} method. |
| 50 | + * This is convenient and intuitive, but if explicit naming is desired, the |
| 51 | + * {@code name} attribute (or its alias {@code value}) may be used. Also note |
| 52 | + * that {@code name} accepts an array of Strings, allowing for multiple names |
| 53 | + * (i.e. a primary bean name plus one or more aliases) for a single bean. |
54 | 54 | * |
55 | 55 | * <pre class="code"> |
56 | | - * @Bean({"b1","b2"}) // bean available as 'b1' and 'b2', but not 'myBean' |
| 56 | + * @Bean({"b1", "b2"}) // bean available as 'b1' and 'b2', but not 'myBean' |
57 | 57 | * public MyBean myBean() { |
58 | 58 | * // instantiate and configure MyBean obj |
59 | 59 | * return obj; |
|
79 | 79 | * <h3>{@code @Bean} Methods in {@code @Configuration} Classes</h3> |
80 | 80 | * |
81 | 81 | * <p>Typically, {@code @Bean} methods are declared within {@code @Configuration} |
82 | | - * classes. In this case, bean methods may reference other {@code @Bean} methods |
83 | | - * in the same class by calling them <i>directly</i>. This ensures that references between |
84 | | - * beans are strongly typed and navigable. Such so-called <em>'inter-bean references'</em> are |
| 82 | + * classes. In this case, bean methods may reference other {@code @Bean} methods in the |
| 83 | + * same class by calling them <i>directly</i>. This ensures that references between beans |
| 84 | + * are strongly typed and navigable. Such so-called <em>'inter-bean references'</em> are |
85 | 85 | * guaranteed to respect scoping and AOP semantics, just like {@code getBean()} lookups |
86 | 86 | * would. These are the semantics known from the original 'Spring JavaConfig' project |
87 | 87 | * which require CGLIB subclassing of each such configuration class at runtime. As a |
|
194 | 194 | * Alias for {@link #name}. |
195 | 195 | * <p>Intended to be used when no other attributes are needed, for example: |
196 | 196 | * {@code @Bean("customBeanName")}. |
197 | | - * @since 5.0 |
| 197 | + * @since 4.3.3 |
198 | 198 | * @see #name |
199 | 199 | */ |
200 | 200 | @AliasFor("name") |
201 | 201 | String[] value() default {}; |
202 | 202 |
|
203 | 203 | /** |
204 | | - * The name of this bean, or if plural, aliases for this bean. |
205 | | - * <p>If left unspecified the name of the bean is the name of the annotated method. |
| 204 | + * The name of this bean, or if several names, a primary bean name plus aliases. |
| 205 | + * <p>If left unspecified, the name of the bean is the name of the annotated method. |
206 | 206 | * If specified, the method name is ignored. |
207 | 207 | * <p>The bean name and aliases may also be configured via the {@link #value} |
208 | 208 | * attribute if no other attributes are declared. |
|
0 commit comments