Annotation Processing in Eclipse

One of the big new features of Java 5 were Annotations (.Net guys call them Attributes). Along with annotations Sun released the Annotation Processor Tool (APT) as well. APT performs parsing Java source code and processes annotations with custom agent programs that can generate additional source code or perform some checking at compile time.

APT is a great tool for framework builders that want to use annotations for more advanced pre-processing without having to build yet another Java parser. APT would be even more convenient to use if IDE tools would support it. Well, the Eclipse (BEA) team built APT integration for Eclipse. It is built-in for Eclipse 3.2, and available for Eclipse 3.1 as a separate download. It supports all the basic APT features and provides support for advanced integration features like auto-completion, quick-fix and process-on-save. See the screenshot to get a bit of a feel for this cool new feature:

Eclipse APT in action