How to visualize mappings done by the Mapstruct #3740
-
|
Hello, I have been searching solution for how to visualize mappings done by the Mapstruct without success. I wonder if someone already had similar problem and has solved it? By the visualization I mean if I can find list where the source property is found in the newly mapped object. Of course I can develop a script for the source code, collect stuff from annotations or implementation files, collect mappings and relations to technical format that can be visualized by the visualization tools. But I wonder if there is a such tool/script already. Developing one for large and complicated mappings would not be a nice task :). |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
|
Can you provide an example of what you mean by visualization? |
Beta Was this translation helpful? Give feedback.
-
|
Hello, When Mapstruct is doing mappings it will generate mappings "log" file in some visualization tool format like GraphViz (DOT Language). "log file": Collected mappings as .js file. namespace Banks { %% Object mappings |
Beta Was this translation helpful? Give feedback.
-
|
In theory you could achieve this by implementing a custom |
Beta Was this translation helpful? Give feedback.
-
|
It doesn't really answer your question, but you can also use this visual mapping tool, which can coexist with MapStruct in your code: |
Beta Was this translation helpful? Give feedback.

In theory you could achieve this by implementing a custom
org.mapstruct.ap.internal.processor.ModelElementProcessor(keep in mind that this is not public API) and generate some visualization if you want to. You'll need to hook into around that same time as theorg.mapstruct.ap.internal.processor.MapperRenderingProcessor