A java program to dispay java doc for a given class

一个Java程序,显示Java DOC对于一个给定的类

Tags: java javadoc
标签: java javadoc

问题 (Question)

How can i write a java program to retrieve and output the javadoc of a given class?

Input: java class say (classA)
Output: java doc of classA

Thanks

我怎么能写一个Java程序检索并输出一个特定类的代码?

Input: java class say (classA)
Output: java doc of classA

感谢

最佳答案 (Best Answer)

Steps:

1. Download JAD

$ jad -o -ddecompiled_sources -sjava *.class

2. Generate the javadoc

$ javadoc -d generated_javadoc -sourcepath decompiled_sources -subpackages java -exclude java.net:java.lang

3. Done

EDIT: As seen on http://stackoverflow.com/a/8798013/3315914, comments are discarded in the compilation process, so you can generate the javadoc, but without comments.

步骤:

1。下载Jad

$ jad -o -ddecompiled_sources -sjava *.class

2。生成的代码

$ javadoc -d generated_javadoc -sourcepath decompiled_sources -subpackages java -exclude java.net:java.lang

3。

编辑http://stackoverflow.com/a/8798013/3315914评论,被丢弃在编译过程中,所以你可以生成Javadoc,但没有评论。

答案 (Answer) 2

No, because the Javadoc isn't in the .class file.

In any case why? Something wrong with your Web browser?

不,不是因为Javadoc进入这类文件。

在任何情况下,为什么?您的Web浏览器有问题吗?

本文翻译自StackoverFlow,英语好的童鞋可直接参考原文:http://stackoverflow.com/questions/22081639