|
341 | 341 | * with the {@code @Profile} annotation to provide two options of the same bean to the |
342 | 342 | * enclosing {@code @Configuration} class. |
343 | 343 | * |
344 | | - * <p>{@link Conditional @Conditional} annotations declared on an enclosing |
345 | | - * {@code @Configuration} class gate registration of any nested |
346 | | - * {@code @Configuration} classes within it when the nested class is reached |
347 | | - * through the parser's recursion from its enclosing class (the case shown |
348 | | - * above) or via {@link Import @Import}. When the nested class is discovered |
349 | | - * independently of its enclosing class, for example via |
350 | | - * {@link ComponentScan @ComponentScan} or by directly registering the nested |
351 | | - * class against the application context, it is processed using only its own |
352 | | - * {@code @Conditional} annotations. In that case, redeclare the relevant |
353 | | - * conditions on the nested class, or extract them into a composed |
354 | | - * annotation applied to both, if the same gating is intended. |
| 344 | + * <p>A {@link Conditional @Conditional} annotation declared on an enclosing |
| 345 | + * {@code @Configuration} class is only applied to the registration of a nested |
| 346 | + * {@code @Configuration} class if the nested class is reached through the parser's |
| 347 | + * recursion from its enclosing class, or via {@link Import @Import}. If a nested |
| 348 | + * class is discovered independently of its enclosing class — for example, |
| 349 | + * via {@link ComponentScan @ComponentScan} or by directly registering it against |
| 350 | + * the application context — it is processed using only its own |
| 351 | + * {@code @Conditional} annotations. Thus, if you wish to ensure that the same |
| 352 | + * {@code @Conditional} annotations apply in such scenarios, you must redeclare |
| 353 | + * the relevant annotations on the nested class, or extract them into a composed |
| 354 | + * annotation which you apply to both the enclosing class and the nested class. |
355 | 355 | * |
356 | 356 | * <h2>Configuring lazy initialization</h2> |
357 | 357 | * |
|
0 commit comments