Refine example to show @NestedConfigurationProperty usage
Closes gh-33239
This commit is contained in:
parent
5c10ae2f0b
commit
5a88468c09
|
@ -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[]
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue