How does the Javadoc deal with the visibility of modules in Java 9?

ⅰ亾dé卋堺 提交于 2019-11-30 04:53:47
Jonathan Gibbons

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!