Simplified Doclet API [JEP-221]
The Doclet API and Javadoc are closely related. Javadoc is a documentation tool and the Doclet API provides functionality so that we can inspect the javadoc comments embedded at the source-levels of libraries and programs. In this section, we will review the pre-Java 9 status of the Doclet API and then explore the changes introduced to the Doclet API in the Java 9 platform. In the following section, we will review Javadoc.
The pre-Java 9 Doclet API
The pre-Java 9 Doclet API, or the com.sun.javadoc
package, gives us access to look at javadoc comments located in the source code. Invoking a Doclet is accomplished by using the start
method. That method's signature is public static boolean start(RootDoc root)
. We will use the RootDoc
instance as a container for the program structure information.
In order to call javadoc, we need to pass the following:
- Package names
- Source file names (for classes and interfaces)
- An access control option--one of the following:
package
private...