mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Document @Conditional gating of nested @Configuration classes
Closes gh-36831 Signed-off-by: Dennis-Mircea Ciupitu <dennis.mircea.ciupitu@gmail.com>
This commit is contained in:
committed by
Sam Brannen
parent
7651d5841f
commit
f3bfe27445
+13
@@ -610,6 +610,19 @@ Kotlin::
|
||||
See the {spring-framework-api}/context/annotation/Conditional.html[`@Conditional`]
|
||||
javadoc for more detail.
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
A `@Conditional` declared on an enclosing `@Configuration` class gates the
|
||||
registration of nested `@Configuration` classes within it only when the
|
||||
nested class is reached through the parser's recursion from its enclosing
|
||||
class, or through `@Import`. When the nested class is discovered
|
||||
independently of its enclosing class, for example via `@ComponentScan` or
|
||||
by directly registering it against the application context, it is processed
|
||||
using only its own `@Conditional` annotations. In that case, redeclare the
|
||||
relevant conditions on the nested class, or extract them into a composed
|
||||
annotation applied to both, if the same gating is intended.
|
||||
====
|
||||
|
||||
|
||||
[[beans-java-combining]]
|
||||
== Combining Java and XML Configuration
|
||||
|
||||
Reference in New Issue
Block a user