Annotation Interface ConfigProperties
@ConfigurationProperties.
When a @ConfigProperties-annotated class is materialized through BeanInstantiator,
its fields are populated from the Settings chain
under prefix() via ConfigPropertiesBinder, and the bound instance is auto-registered
into the current BeanStore.
Binding order and lifecycle
The whole-object config bind runs after @Value/@Inject field-and-method injection and
before any @PostConstruct method — so a
@PostConstruct method observes the fully-bound config fields. Fields that are themselves annotated with
@Value or @Inject are left to the injection engine and are never overwritten by config binding,
even when a matching prefix.fieldName key exists.
Caller-scoped sources
The bind consults any PropertySource-typed beans in the
active BeanStore ahead of the global Settings
chain, so a caller can layer overriding or supplementary sources without mutating the shared
Settings.get() singleton.
Not inherited
This annotation is not @Inherited: the BeanInstantiator
trigger fires only when the exact declared type being instantiated carries the annotation — a subclass or
interface implementor of an annotated type does not itself trigger binding or auto-registration.
This is distinct from the ConfigPropertiesBinder nested-field detection, which is
inheritance-aware: a field whose declared type is a subclass of an @ConfigProperties-annotated
type still triggers nested binding under the enclosing type's prefix, since the annotation lookup there walks the
declared field type's class hierarchy rather than requiring an exact-type match.
Example:
@ConfigProperties and @Value coexist: @Value
resolves a single value; @ConfigProperties resolves a whole object. A class can use
@Value fields internally and separately be the target of another class's nested
@ConfigProperties bind.
See Also:
- Since:
- 10.0.0
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether relaxed (camelCase / kebab-case / dotted /SCREAMING_SNAKE_CASE) key matching is enabled.
-
Element Details
-
prefix
The property-key prefix (no trailing dot).Ignored when the annotated type appears as a nested field of another
@ConfigPropertiestype — the enclosing type's prefix (extended with the field name) wins for the nested bind.- Returns:
- The prefix.
-
-
-
relaxed
boolean relaxedWhether relaxed (camelCase / kebab-case / dotted /SCREAMING_SNAKE_CASE) key matching is enabled.Ignored when the annotated type appears as a nested field of another
@ConfigPropertiestype — the enclosing type'srelaxedflag wins for the nested bind.- Returns:
true if relaxed matching is enabled. Defaults totrue .
- Default:
- true
-