November 2004
Intermediate to advanced
1024 pages
27h 50m
English
One use for annotation is the automatic generation of “side files” that contain additional information about programs. The “Enterprise Edition” of Java is notorious for making programmers fuss with lots of boilerplate code, and an effort is underway to develop a standardized set of annotations to generate most of it automatically.
In this section, we demonstrate this technique with a simpler example. We write a program that automatically produces bean info classes. You tag bean properties with an annotation and then run a tool that parses the source file, analyzes the annotations, and writes out the source file of the bean info class. Rather than writing our own parser, we use an annotation ...
Read now
Unlock full access