开发者

Can you generate a package and group of classes through templates in Eclipse?

开发者 https://www.devze.com 2023-03-09 05:14 出处:网络
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,

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

精彩评论

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