mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#2686 Add documentation about when mappers are injected
This commit is contained in:
parent
f7f65ac1de
commit
59c5f40ac3
@ -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>>.
|
||||
|
Loading…
x
Reference in New Issue
Block a user