Source View Technology Merges APT and AST to Make Java Code Enhancements Visible
A new approach called Source View Technology aims to overcome the individual limitations of two Java compile-time tools: APT (Annotation Processing Tool) and AST (Abstract Syntax Tree) modification. APT can generate observable, debuggable source files but cannot modify existing classes by producing a class with the same fully qualified name. AST modification, used by tools like Lombok, can enhance existing classes in memory at compile time but leaves those changes hidden, undebuggable, and only inspectable by decompiling bytecode. Source View Technology combines both approaches by using AST to modify classes and then outputting the result as source files, called View Classes, which coexist with the original developer-written classes. At compile time, these View Classes replace the originals, giving developers the ability to modify existing classes while keeping all enhancements fully visible and debuggable.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in