Annotation Processing per Compiler-Plugin
Annotation Processing
Annotations were added to the Java programming language in release 5.0
and were rapidly adopted as a means for building tools of all sorts.
For this reason, annotations are usually defined and processed by tool
providers (such as Junit, EJB 3, etc.). While Java developers use
pre-defined "tool" annotation, they rarely ever define and process annotations
of their own. However, definition and processing of annotations is
fairly easy, especially since Java 6.0, where the Java compiler support
annotation processing on the source code level by means of compiler plug-ins.
Knowledge of annotation processing enables developers to build utilities
of their own.
This tutorial aims to provide a brief overview of annotations (their
definition and usage) and of annotation processing at runtime via reflection
and on the source code level via compiler plug-ins. Using a case
study we will illustrate the implementation of a compiler-plugin for processing
annotations in the source code. |
|
PREREQUISITES
|
|
Level:
|
intermediate |
Duration:
|
45-90 min |
Prerequisites:
|
Java developers with an interest in less commonly used
language features in general or annotations in particular. |
Presented at:
|
W-JAX 2007,
München, Germany, November 5-9, 2007
J-Spring 2008, Bussum,
Netherlands, April 16, 2008
JAX 2008, Wiesbaden, Germany,
April 21-25, 2008
Java Forum Stuttgart 2008,
Stuttgart, Germany, July 3, 2008
|
If you are interested to hear more about this
and related topics you might want to check out the following seminar or
skim through some further reading:
|
|
Seminars
|
Articles
|
|