From 59c5f40ac3c6f83e0e4c333a9ed67ae23b6ae664 Mon Sep 17 00:00:00 2001 From: Filip Hrisafov Date: Tue, 18 Jan 2022 18:22:47 +0100 Subject: [PATCH] #2686 Add documentation about when mappers are injected --- .../src/main/asciidoc/chapter-4-retrieving-a-mapper.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/main/asciidoc/chapter-4-retrieving-a-mapper.asciidoc b/documentation/src/main/asciidoc/chapter-4-retrieving-a-mapper.asciidoc index 724b42fbb..67db28c7c 100644 --- a/documentation/src/main/asciidoc/chapter-4-retrieving-a-mapper.asciidoc +++ b/documentation/src/main/asciidoc/chapter-4-retrieving-a-mapper.asciidoc @@ -117,7 +117,7 @@ public interface CarMapper { ---- ==== -The generated mapper will inject all classes defined in the **uses** attribute. +The generated mapper will inject classes defined in the **uses** attribute if MapStruct has detected that it needs to use an instance of it for a mapping. When `InjectionStrategy#CONSTRUCTOR` is used, the constructor will have the appropriate annotation and the fields won't. When `InjectionStrategy#FIELD` is used, the annotation is on the field itself. For now, the default injection strategy is field injection, but it can be configured with <>.