-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: documentationA documentation updateA documentation update
Description
This paragraph is a bit ambiguous and could benefit from some rewording:
Even if the preceding configuration creates a regular bean for
AcmeProperties
, we
recommend that@ConfigurationProperties
only deal with the environment and, in
particular, does not inject other beans from the context. Having said that, the
@EnableConfigurationProperties
annotation is also automatically applied to your
project so that any existing bean annotated with@ConfigurationProperties
is
configured from theEnvironment
. You could shortcutMyConfiguration
by making sure
AcmeProperties
is already a bean, as shown in the following example:
- Why is this section started with Even if the preceding configuration creates a regular bean for
AcmeProperties
[...], in particular Even if? It either creates a bean or it doesn't. From memory, merely annotating a POJO with@ConfigurationProperties
does not turn it into a bean. Even if it did, this paragraph should read The preceding configuration creates a regular bean forAcmeProperties
- Then, why is it connected to the next paragraph using Having said that [...]?
- Finally, in You could shortcut
MyConfiguration
[...], what are we shortcutting? In other words, what is getting shortcut if we annotateMyConfiguration
with@Component
? It turns the POJO into a bean, but what is getting shortcut?
Metadata
Metadata
Assignees
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: documentationA documentation updateA documentation update