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
    • protected
    • public

When the preceding listed items are used to call javadoc, a documented set is provided as a filtered list. If our aim is to obtain a comprehensive, unfiltered list, we can ...

Get Java 9: Building Robust Modular Applications 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.