寻找一个Java代码生成库 [英] Looking for a java code generation library
问题描述
什么是好的 Java代码生成库?
我在JaxMe中找到了一代人,但它又穷又老。
我喜欢通过Java代码生成Java代码。因此,基本上使用lib来告诉它必须生成具有X字段,Y方法等的特定具体类或接口,然后将其写入文件系统。
我知道框架会使用它们,但是找不到独立的库。.
-Ed
What is/are "good" java code generation libs? I found a generation part in JaxMe, but it's poor and old. I like to generate java code through java code. So basically use a lib to tell that it has to generate a certain concrete class or interface with X fields, Y methods, etc.. that are then written to the file system.. I know that frameworks use them, but can't find a standalone lib.. - Ed
推荐答案
有几个库,具有各种功能并且易于使用使用:
There are several libraries with various capabilities and ease of use:
- Javassist
- Apache BCEL
- ASM
- cglib
您可能需要查看每个API的API,以确定哪个API更适合您的目的。
You will probably have to take a look at the API of each one to determine which one is more suitable for your purposes.
这篇关于寻找一个Java代码生成库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!