Annotations are a Java 5 language feature that let you add metadata to your code, in a rigorous, type-safe way that can be supported by the compiler. Annotations resemble javadoc in some regards, but are more tightly integrated into the Java language. Eclipse’s support for annotations has been deepening with each of the last few releases, and Eclipse 3.4 will be better still. Join members of the Eclipse JDT annotation processing team for an in-depth discussion of what annotations can do for you and how to work with them! We’ll discuss:
- How annotations compare to javadoc: strengths and weaknesses of each, and their historical relationship
- Syntax and structure of annotations: how to write an annotation type and use it to annotate code
- Standard compiler-supported annotation types such as @Deprecated
- Meta-annotations: how to specify what language elements an annotation can be applied to, whether the annotation will be preserved in the compiled class, and other useful tricks
- Common annotations for web-related applications, and how these annotations can be used by an application container
- Compile-time annotation processing (APT): how to generate files and report problems during compilation, based on annotations in the code
- JSR 305: annotations for software defect detection
- Problems that annotations and annotation processing are not good at solving
We’ll try to leave some time for Q&A at the end of the talk, too. A basic understanding of the Java language will help you get the most out of this talk, but you do not need to know anything about Java 5 in particular.
Walter Harley is a senior software engineer on the BEA Weblogic Workshop Compiler Team, and a committer on the Eclipse APT project. Prior to this, he worked on XML data integration, cryptography, mainframe terminal emulation and macro assemblers. His interests include audio electronics, music, hiking, and pastry. He holds a Ph.D. in cognitive psychology from Johns Hopkins University.