Javadoc 的好例子
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1079713/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
good example of Javadoc
提问by Jason S
is there a good example of a source filecontaining Javadoc?
是否有包含Javadoc的源文件的好示例?
I can find lots of good examples of Javadoc on the internet, I would just like to find out the particular syntax used to create them, and assume I can pore through the source of some library somewhere but that seems like a lot of work.
我可以在互联网上找到很多 Javadoc 的好例子,我只想找出用于创建它们的特定语法,并假设我可以在某个地方仔细阅读某个库的源代码,但这似乎需要做很多工作。
采纳答案by GaryF
How about the JDK source code, but accessed through a 3rd party like docjar? For example, the Collections source.
JDK 源代码如何,但通过第三方(如 docjar)访问?例如,集合源。
That way, there's no big download.
这样,就没有大的下载。
回答by RichieHindle
回答by dfa
I use a small set of documentation patterns:
我使用一小组文档模式:
- always documenting about thread-safety
- always documenting immutability
- javadoc with examples (like Formatter)
- @Deprecation with WHY and HOW to replace the annotated element
- 总是记录关于线程安全
- 始终记录不变性
- 带有示例的 javadoc(如Formatter)
- @Deprecation 使用 WHY 和 HOW 替换带注释的元素
回答by Jared Oberhaus
The page How to Write Doc Coments for the Javadoc Toolcontains a good number of good examples. One section is called Examples of Doc Commentsand contains quite a few usages.
如何为 Javadoc 工具编写文档注释页面包含大量优秀示例。一节称为文档注释示例,其中包含相当多的用法。
Also, the Javadoc FAQcontains some more examples to illustrate the answers.
此外,Javadoc FAQ包含更多示例来说明答案。
回答by Nick Fortescue
ANT for example - source code browsable online: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/DefaultLogger.java?view=co
例如 ANT - 可在线浏览的源代码:http: //svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/DefaultLogger.java?view=co
To choose other files start from: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/?pathrev=761528
选择其他文件从:http: //svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/?pathrev=761528
回答by Jesse
If all your looking for is the syntax, then this may help:
如果您寻找的只是语法,那么这可能会有所帮助:
回答by Thorbj?rn Ravn Andersen
If you install a JDK and choose to install sources too, the src.zip contains the source of ALL the public Java classes. Most of these have pretty good javadoc.
如果您安装了 JDK 并选择安装源代码,则 src.zip 包含所有公共 Java 类的源代码。其中大部分都有很好的javadoc。
回答by Ga?l Marziou
Have a look at Spring framework source, it has excellent javadocs
看看 Spring 框架源,它有很好的 javadocs
回答by KrishPrabakar
If you are using Eclipse, then you can setup your JDK(not JRE) in Installed JREs, and then use Open Type(Ctrl+ Shift+ T), give something like java.util.Collections
如果你正在使用Eclipse的,那么你可以设置你的JDK(不是JRE)在安装的JRE,然后用开放式(Ctrl+ Shift+ T),给像java.util.Collections