Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 Factory 创建类后,如何漂亮地打印生成的类源代码?
您可以toString()在 AST 节点上调用:
toString()
CtClass c = getFactory().Core().createClass(); // fill c with stuff System.out.println(c.toString())