Polish "Allow NestedConfigurationProperty on getters"
See gh-38844
This commit is contained in:
@@ -17,6 +17,7 @@ include-code::Nested[]
|
||||
|
||||
The example above produces configuration properties for `my.properties.name` and `my.properties.nested.number`.
|
||||
Without the `@NestedConfigurationProperty` annotation on the `nested` field, the `my.properties.nested.number` property would not be bindable in a native image.
|
||||
You can also annotate the getter method.
|
||||
|
||||
When using constructor binding, you have to annotate the field with `@NestedConfigurationProperty`:
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ Consider the updated example:
|
||||
include-code::MyServerProperties[]
|
||||
|
||||
The preceding example produces metadata information for `my.server.name`, `my.server.host.ip`, and `my.server.host.port` properties.
|
||||
You can use the `@NestedConfigurationProperty` annotation on a field to indicate that a regular (non-inner) class should be treated as if it were nested.
|
||||
You can use the `@NestedConfigurationProperty` annotation on a field or a getter method to indicate that a regular (non-inner) class should be treated as if it were nested.
|
||||
|
||||
TIP: This has no effect on collections and maps, as those types are automatically identified, and a single metadata property is generated for each of them.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user