The Javadoc tool generates documentation based on the accessibility modifier. By default, it document all public
and protected
classes, fields and
javadoc has new options that allow you to select which items are documented at the module, package, type and member level. Using an EA version of JDK 9, look for new --module
, --show-*
options, and --expand-requires
options.
The existing options -public
, -protected
, -package
, -private
options have been redefined in terms of the new --show-*
options, although their command line help still needs to be updated.
The handy-dandy conversion table is:
-public
--show-module-contents api --show-packages exported --show-types public --show-members public
-protected (the long-standing default)
--show-module-contents api --show-packages exported --show-types protected --show-members protected
-package
--show-module-contents all --show-packages all --show-types package --show-members package
-private
--show-module-contents all --show-packages all --show-types private --show-members private
In general, continue to use the default to generate documentation for users of an API, and maybe use -package
or -private
to generate documentation for the developers of an API. For more fine-grain control, use the underlying --show-*
options.