2.10 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access