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]]
|
||||
=== Nested Configuration Properties
|
||||
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[]
|
||||
|
||||
|
|
|
@ -41,20 +41,20 @@ public class MyProperties {
|
|||
}
|
||||
// @fold:off
|
||||
|
||||
public static class Nested {
|
||||
}
|
||||
|
||||
private int number;
|
||||
class Nested {
|
||||
|
||||
// @fold:on // getters / setters...
|
||||
public int getNumber() {
|
||||
return this.number;
|
||||
}
|
||||
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
}
|
||||
// @fold:off
|
||||
private int number;
|
||||
|
||||
// @fold:on // getters / setters...
|
||||
public int getNumber() {
|
||||
return this.number;
|
||||
}
|
||||
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
}
|
||||
// @fold:off
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue