From 13900060a6aa97df30003865abe7ed27561ca7c8 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Tue, 12 Jan 2021 14:51:37 +0100 Subject: [PATCH] Add CAUTION admonitions about the use of static classes to ITypeConverter and IModelTransformer (#1297) --- docs/index.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/index.adoc b/docs/index.adoc index d95a47f8c..e4872fd32 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -1404,6 +1404,8 @@ This may also be useful for applications that need a custom type converter but w Type converters declared with the `converter` attribute need to have a public no-argument constructor to be instantiated, unless a <> is installed to instantiate classes. +CAUTION: If your type converter is declared as nested class, make sure you mark this class as `static`, or picocli will not be able to instantiate your nested converter class without a <>. + === Arrays, Collections, Maps NOTE: Starting from picocli 2.0, the `type` attribute is no longer necessary for `Collection` and `Map` fields: picocli will infer the collection element type from the generic type. @@ -10186,6 +10188,7 @@ class Dynamic { All transformers are called once, after the full command hierarchy is constructed, and before any command line arguments are parsed. +CAUTION: If your model transformer is declared as nested class, make sure you mark this class as `static`, or picocli will not be able to instantiate your transformer class without a <>. === Automatic Parameter Indexes ==== Automatic Indexes