可以在Eclipse中通过模板生成一个包和一组类吗?
我的所有域对象都遵循非常相似的结构,如果我想在应用程序中存储 Address 对象,我会在 .address 包中创建一个 Address、IAddressService、AddressServiceImpl 以及相应测试包中的 AddressServiceImplTest。所有这些对象看起来都可以轻松模板化,但是我通常发现自己只是复制类似的域对象并手动重命名类。
eclipse中是否有一个模板方法或一个插件,可以针对这种类型的场景一次性自动生成多个类和多个包?
All of my domain objects follow a very similar structure, if I wanted to store Address objects in my application, I would create in a .address package an Address, IAddressService, AddressServiceImpl, as well as an AddressServiceImplTest in a corresponding test package. All of these objects seem like they could be easily templated, however I usually find myself just copying a similar domain object and renaming classes manually.
Is there a template method in eclipse, or a plugin, that could autogenerate several classes and several packages in one shot for this type of scenario?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道有预先构建的解决方案。
但是,您可以考虑使用编写自己的专用模板引擎
Java 发射器模板。
I am not aware of a prebuilt solution.
However, you can consider writing your own, specialized template engine using
Java Emitter Templates.