Spoon
A Java metaprogramming library that parses source files into a full AST and provides an API for analyzing, rewriting, transforming and transpiling Java source code, supporting Java versions up to 25.
Spoon is an open-source library for analyzing, rewriting, transforming and transpiling Java source code. It parses source files into a well-designed AST and exposes an analysis and transformation API, supporting modern Java versions up to Java 25.
Its design keeps the model close to the language's own concepts, complete and sound, with a text-rendering of a modified model that stays close to the original source and semantically equivalent to it, and transformation operators that report invalid programs as early as possible through static typing or dynamic checks.
It is an official Inria open-source project and a member of the OW2 open-source consortium, installed via Maven, with reference documentation, code examples and conference talks available.