Extending a lombok annotation using Spring's meta-annotations

匆匆过客 提交于 2019-12-12 21:14:46

问题


I recently discovered lombok and I enjoy the comfort it's usage brings. There is only one particular thing I am missing.

So just out of curiosity: How could I extend the @AllArgsConstructor annotation in a way that it provides an additional default constructor to the class on which it is applied?

I was thinking of using Spring 4.0's capability to build composed annotations, but I must admit I never programmed a custom annotation before. So I don't really know how to start ...

Any suggestions?


回答1:


I don't know how to extend the annotation, but if you want to add a default constructor, you can add the Lombok @NoArgsConstructor annotation.



来源:https://stackoverflow.com/questions/21750094/extending-a-lombok-annotation-using-springs-meta-annotations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!