From 5a88468c0938a046d3aa60ba06e26523dd1ce190 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Fri, 18 Nov 2022 10:25:30 +0100 Subject: [PATCH] Refine example to show @NestedConfigurationProperty usage Closes gh-33239 --- .../native-image/advanced-topics.adoc | 2 +- .../MyProperties.java | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/native-image/advanced-topics.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/native-image/advanced-topics.adoc index 285758ebe009..a7e8f11169d7 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/native-image/advanced-topics.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/native-image/advanced-topics.adoc @@ -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[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/nativeimage/advanced/nestedconfigurationproperties/MyProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/nativeimage/advanced/nestedconfigurationproperties/MyProperties.java index f4d064e05ffd..0f73ef5dd68c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/nativeimage/advanced/nestedconfigurationproperties/MyProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/nativeimage/advanced/nestedconfigurationproperties/MyProperties.java @@ -41,20 +41,20 @@ public Nested getNested() { } // @fold:off - public static class Nested { +} - private int number; +class Nested { - // @fold:on // getters / setters... - public int getNumber() { - return this.number; - } + private int number; - public void setNumber(int number) { - this.number = number; - } - // @fold:off + // @fold:on // getters / setters... + public int getNumber() { + return this.number; + } + public void setNumber(int number) { + this.number = number; } + // @fold:off }