Spoon Notes
Links: - API Docs - Documentation - Spoon examples - Github Repository - spoon-maven-plugin - spoon-smpl
1 Installation¶
- maven plugin
- jar 包下载
2 Code Analysis¶
2.1 AST¶
构建 java代码的 AST
java -cp .\spoon-core-9.2.0-beta-7-jar-with-dependencies.jar spoon.Launcher -i .\MyClass.java --gui
2.2 Code Analysis¶
static code analysis
3 Spoon Meta Model¶
The Spoon meta-model can be split into three parts:
- The structural part contains the declarations of the program elements, such as interface, class, variable, method, annotation, and enum declarations.
- The code part contains the executable Java code, such as the one found in method bodies.
- The reference part models the references to program elements (for instance a reference to a type).


