@@ -814,6 +814,51 @@ special handling for collection types (that is detected even if only a getter is
814
814
The annotation processor also supports the use of the `@Data`, `@Getter`, and `@Setter`
815
815
lombok annotations.
816
816
817
+
818
+ The annotation processor cannot auto-detect default values for ``Enum``s and ``Collections``s.
819
+ In the cases where a `Collection` or `Enum` property has a non-empty default value,
820
+ <<configuration-metadata-additional-metadata,manual metadata>> should be provided.
821
+
822
+ Consider the following class:
823
+
824
+ [source,java,indent=0,subs="verbatim,quotes,attributes"]
825
+ ----
826
+ @ConfigurationProperties(prefix="rabbit")
827
+ public class RabbitProperties {
828
+
829
+ private List<String> addresses = new ArrayList<>(Arrays.asList("a", "b")) ;
830
+
831
+ private ContainerType = ContainerType.SIMPLE;
832
+
833
+ // ... getter and setters
834
+
835
+ public enum ContainerType {
836
+
837
+ SIMPLE,
838
+
839
+ DIRECT
840
+
841
+ }
842
+
843
+ }
844
+ ----
845
+
846
+ In order to document default values for properties in the class above, you could add the following
847
+ JSON to <<configuration-metadata-additional-metadata,the manual metadata of the module>>:
848
+
849
+ [source,json,indent=0]
850
+ ----
851
+ {
852
+ "name": "rabbit.addresses",
853
+ "defaultValue": "a, b"
854
+ },
855
+ {
856
+ "name": "rabbit.container-type",
857
+ "defaultValue": "simple"
858
+ }
859
+ ----
860
+
861
+
817
862
[NOTE]
818
863
====
819
864
If you are using AspectJ in your project, you need to make sure that the annotation
0 commit comments