#2686 Add documentation about when mappers are injected

This commit is contained in:
Filip Hrisafov 2022-01-18 18:22:47 +01:00 committed by GitHub
parent f7f65ac1de
commit 59c5f40ac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 <<configuration-options>>.