Refine example to show @NestedConfigurationProperty usage

Closes gh-33239
This commit is contained in:
Moritz Halbritter 2022-11-18 10:25:30 +01:00
parent 5c10ae2f0b
commit 5a88468c09
2 changed files with 12 additions and 12 deletions

View File

@ -6,7 +6,7 @@
[[native-image.advanced.nested-configuration-properties]] [[native-image.advanced.nested-configuration-properties]]
=== Nested Configuration Properties === Nested Configuration Properties
Reflection hints are automatically created for configuration properties by the Spring ahead-of-time engine. Reflection hints are automatically created for configuration properties by the Spring ahead-of-time engine.
Nested configuration properties, however, *must* be annotated with `@NestedConfigurationProperty`, otherwise they won't be detected and will not be bindable. Nested configuration properties which are no inner classes, however, *must* be annotated with `@NestedConfigurationProperty`, otherwise they won't be detected and will not be bindable.
include::code:MyProperties[] include::code:MyProperties[]

View File

@ -41,7 +41,9 @@ public class MyProperties {
} }
// @fold:off // @fold:off
public static class Nested { }
class Nested {
private int number; private int number;
@ -55,6 +57,4 @@ public class MyProperties {
} }
// @fold:off // @fold:off
}
} }