The Java 9 modules feature adds (higher-level) module-info
files in addition to the package-info
files that existed previously. Can module-info.java
(source-code) files include marked-up comments that the JavaDoc tool will extract and present (usefully) as module-level documentation?
Asked
Active
Viewed 1,822 times
7
2 Answers
7
In a word - yes. You can see, for example, how Java 9's Javadoc has module-level documentation (including tags for provides
, uses
, moduleGraph
), which then lists the packages in them with their documentation. The packages, in turn, contain classes with their documentation.
As a quick example, check out the jdk.jshell
module documentation.
-
What about adding comments ( `//` ) over a package export declaration inside `module-info.java`? Is this allowed? – Marinos An Jun 18 '20 at 13:56
-
Yes you can, @MarinosAn – dan Dec 13 '22 at 20:04
-
BTW, `@moduleGraph` isn't supported by the standard doclet; the JDK bubba's are doing something special to support that. – dan Feb 15 '23 at 21:31
3
Yes. And the tags supported at module declaration are:
Module Declaration
{@author}, {@deprecated}, {@provides}, {@see}, {@since}, {@serialField}, {@uses}, {@version}
{@code}, {@docRoot}, {@index}, {@link}, {@linkplain}, {@literal}, {@summary}
Source:- Documentation Comment Specification for the Standard doclet
Amongst these, the newly introduced tags you might further be interested in are :
and then module
specific