O'Reilly logo

Programming Groovy 2 by Venkat Subramaniam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Groovy Code-Generation Transformations

Groovy tactfully eases the tension that language designers often face between a desire to evolve the language and a reluctance to modify the grammar due to its impact on performance, complexity, and semantic correctness. Rather than modifying the core syntax of the language, the Groovy compiler recognizes select annotations and generates appropriate code. In this section you’ll learn about a few such annotations. Chapter 16, Applying Compile-Time Metaprogramming, covers how to create our own annotations for custom transformations.

Groovy provides a number of code-generation annotations in the groovy.transform package and a few other packages. We’ll talk about a few of these annotations in this section. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required