Annotation Tools

A number of annotation facilities are available for the Java environment. We already mentioned Javadoc, which is built into Java and is aimed at autogeneration of HTML documentation for Java code. Javadoc is somewhat extensible in itself. You can write your own custom Javadoc processor to take code with Javadoc comments and generate your own documentation formats. You can also define your own custom Javadoc tags and handle them in your custom Javadoc handlers.

Javadoc is, however, aimed principally at documentation-oriented code annotations and is used almost exclusively for that purpose. Since this book is about enterprise application development, we discuss XDoclet and J2SE annotations—annotation tools that are particularly relevant to enterprise contexts. XDoclet includes a wide array of predefined annotations for enterprise development, and J2SE annotations are being used to define standard annotations in the next versions of key enterprise Java APIs.

Get Java Enterprise in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.