Add support for custom name in Spring stereotype annotations#3019
Add support for custom name in Spring stereotype annotations#3019filiphr merged 8 commits intomapstruct:mainfrom
Conversation
…dy annotated as Spring stereotype
|
This solution only covers one out of many options for the Try creating a check that walks the meta-annotation tree instead of something that only checks the top level annotation. |
|
Thank you very much for the feedback @Zegveld. I absolutely agree with you: I initially thought of including checks for Again, thank you very much for the feedback, and sorry for this first baby step. |
Check the existence of the @component annotation across the full annotation hierarchy.
|
@Zegveld Sorry for the late reply. I have pushed some new changes. Per your suggestion, I tried to process the Please let me know what additional work needs to be done. Thank you very much. |
filiphr
left a comment
There was a problem hiding this comment.
The implementation looks good @jccampanero. I only have some points regarding the tests.
I do not think that we should complicate them that much. Do we really need to test this entirely using this in the Spring context. I think that it is enough to what we are doing in SpringAnnotateWithMapperTest without the spring context testing. We could also simplify the mappers by not doing Mapper#uses and without extending from other mappers. We can have empty mappers for the tests.
...t/injectionstrategy/spring/annotateWith/decorator/SpringAnnotateWithDecoratorMapperTest.java
Outdated
Show resolved
Hide resolved
...ct/ap/test/injectionstrategy/spring/annotateWith/qualified/SpringAnnotateWithMapperTest.java
Outdated
Show resolved
Hide resolved
...ct/ap/test/injectionstrategy/spring/annotateWith/qualified/SpringAnnotateWithMapperTest.java
Outdated
Show resolved
Hide resolved
...ct/ap/test/injectionstrategy/spring/annotateWith/qualified/SpringAnnotateWithMapperTest.java
Outdated
Show resolved
Hide resolved
...ct/ap/test/injectionstrategy/spring/annotateWith/qualified/SpringAnnotateWithMapperTest.java
Outdated
Show resolved
Hide resolved
...ct/ap/test/injectionstrategy/spring/annotateWith/qualified/SpringAnnotateWithMapperTest.java
Outdated
Show resolved
Hide resolved
…ntext. Remove unnecessary line endings.
|
Thank you very much for the code review @filiphr, I appreciate it a lot. I updated the code with the changes you requested. Please let me know if any additional changes need to be made. |
|
Thanks a lot for your patience @jccampanero. We've integrated this into main. |
|
Thank you very much @filiphr. Please, on the contrary, thank you very much for your time and for allowing me to contribute to this wonderful library. |
Adds support for defining a custom name for the Spring stereotype annotations (
@Component,@Service) in the generatedMapperwhen using the Spring component model.Fixes #1427