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 | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 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 285758ebe0..a7e8f11169 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 f4d064e05f..0f73ef5dd6 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 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 + }