Groovy AST transformations tutorials
Groovy is a powerful language that gives the opportunity to its users to plugin into the compilation process to create what we call AST transformations, ie. the ability to customize the Abstract Syntax Tree representing your programs before the compiler walks this tree to generate Java bytecode.
Since Groovy 1.6, many useful such transformations have been added to Groovy, like @Delegate to implement delegation, @Immutable to make your types immutable, or @Grab to add dependencies to your scripts, and many more. However, mastering the Groovy AST and compiler APIs is not such a simple task, and requires some advanced knowledge of the inner workings of Groovy.
Read more...

