javadoc “@author” not showing?

给你一囗甜甜゛ 提交于 2019-12-12 10:39:40

问题


Whenever I type in "Printing" and hit CTRL Q in intelliJ I can only see the "Summary" and I cant see "Bob" . . . what am I doing wrong?

package printing;
 /**
 * @author Bob
 * <b>Summary</b>
 */
public class Printer {
//stuff
}

***Note: I am just learning how to use the "javadoc" so I would appreciate an explanation.

EDIT: I cant even see "Summary" unless I take out the "@author"


回答1:


I can reproduce this behavior and have raised an issue to track this : http://youtrack.jetbrains.com/issue/IDEA-114499

Here is the bit of code I used:

package printing;

/**
 * @author Simba
 * @version 1
 * @see java.util.Arrays
 * @since 1
 */
public class Printer {
}

And the resulting documentation:


However, if you try to generate the javadoc via Tools -> Generate JavaDoc with the following settings :

then, the resulting generated javadoc does show the author tag:

therefore proving that the javadoc itself is sound and that it is IntelliJ that does not display it.




回答2:


Sounds like a problem/feature of IntelliJ. Eclipse shows whole javadoc including @author. Other possible problem is a presence of <b>Summary</b> right after @author.

So, try to remove the summary and see what happens. Try also to really generate javadoc, e.g. run javadoc utility from command line and see what happens. I am sure that in this case Bob will appear. Good luck.




回答3:


When javadoc is used from the console, you can add the -author and -version options to the call like this (-d sets the output directory):

javadoc src/main/java/com/*.java -d src/docs/javadocs/ -author -version

Author and version are displayed using those settings.


The javadoc help (by just typing javadoc) shows the following - as AlexR already mentioned - (shortened):

...
Provided by Standard doclet:
  -d <directory>                   Destination directory for output files
  -use                             Create class and package usage pages
  -version                         Include @version paragraphs
  -author                          Include @author paragraphs
...


来源:https://stackoverflow.com/questions/19186239/javadoc-author-not-showing

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