是否有任何Java库使用注释来生成代码? [英] Do any Java libraries use annotations for code generation?

查看:98
本文介绍了是否有任何Java库使用注释来生成代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道使用这篇文章用于自动为标准java类生成标准Object方法toString(),equals()和hashcode()?

Is anyone aware of a library that uses the the techniques (annotations and classworking) described in this article for automatically generating the standard Object methods toString(), equals() and hashcode() for standard java classes?

推荐答案

是的,项目龙目岛这样做。请参见 http://projectlombok.org 。它不仅支持javac,还支持Eclipse。因此这些方法不在源代码中,而是显示在大纲视图中。

Yes, project Lombok does this. See http://projectlombok.org . It not only supports javac, but also Eclipse. So the methods are not in the source code, but are displayed in the outline view.

这篇关于是否有任何Java库使用注释来生成代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆