You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/chapter-3-mapper-as-converter.asciidoc
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ This allows using the Mapper indirectly via the `ConversionService`:
29
29
----
30
30
====
31
31
32
-
All this can be achieved already with MapStruct's core functionality. However, when a Mapper wants to https://mapstruct.org/documentation/stable/reference/html/#invoking-other-mappers[invoke] another one, it can't take the route via the `ConversionService`, because the latter's `convert` method does not match the signature that MapStruct expects for a mapping method. Thus, the developer still has to add every invoked Mapper to the invoking Mapper's `uses` element. This creates (aside from a potentially long list) a tight coupling between Mappers that the `ConversionService` wants to avoid.
32
+
All this can be achieved already with MapStruct's core functionality. However, when a Mapper wants to https://mapstruct.org/documentation/stable/reference/html/#invoking-other-mappers[invoke] another one, it can't take the route via the `ConversionService`, because the latter's `convert` method does not match the signature that MapStruct expects for a mapping method. Thus, the developer still has to add every invoked Mapper to the invoking Mapper's `uses` element. This creates (aside from a potentially long list) a tight coupling between Mappers that the `ConversionService` is designed to avoid.
33
33
34
34
This is where MapStruct Spring Extensions can help. Including the two artifacts in your build will generate an Adapter class that _can_ be used by an invoking Mapper. Let's say that the above CarMapper is accompanied by a SeatConfigurationMapper:
35
35
@@ -61,12 +61,12 @@ public class ConversionServiceAdapter {
Copy file name to clipboardExpand all lines: examples/classname/src/test/java/org/mapstruct/extensions/spring/example/ConversionServiceAdapterIntegrationTest.java
Copy file name to clipboardExpand all lines: examples/custom-conversion-service-bean/src/test/java/org/mapstruct/extensions/spring/example/ConversionServiceAdapterIntegrationTest.java
Copy file name to clipboardExpand all lines: examples/noconfig/src/test/java/org/mapstruct/extensions/spring/example/ConversionServiceAdapterIntegrationTest.java
Copy file name to clipboardExpand all lines: examples/packagename-and-classname/src/test/java/org/mapstruct/extensions/spring/example/ConversionServiceAdapterIntegrationTest.java
Copy file name to clipboardExpand all lines: examples/packagename/src/test/java/org/mapstruct/extensions/spring/example/ConversionServiceAdapterIntegrationTest.java
0 commit comments