开发者

Can you generate a package and group of classes through templates in 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 wel开发者_高级运维l 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?


I am not aware of a prebuilt solution. However, you can consider writing your own, specialized template engine using Java Emitter Templates.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜