标签: java annotations code-generation spoon
使用Factory创建类后,如何漂亮地打印生成的类源代码?
答案 0 :(得分:0)
您可以在AST节点上致电toString():
toString()
CtClass c = getFactory().Core().createClass(); // fill c with stuff System.out.println(c.toString())