good example of Javadoc [closed]

跟風遠走 提交于 2019-11-27 09:06:47

问题


is there a good example of a source file containing 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.


回答1:


How about the JDK source code, but accessed through a 3rd party like docjar? For example, the Collections source.

That way, there's no big download.




回答2:


The page How to Write Doc Coments for the Javadoc Tool contains a good number of good examples. One section is called Examples of Doc Comments and contains quite a few usages.

Also, the Javadoc FAQ contains some more examples to illustrate the answers.




回答3:


How about the JDK source code?




回答4:


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



回答5:


Have a look at Spring framework source, it has excellent javadocs




回答6:


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

To choose other files start from: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/?pathrev=761528




回答7:


Download the sources of Lucene and see how they do it. They have good JavaDocs.




回答8:


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




回答9:


The documentation of Google Guava's EventBus package and classes is a good example of Javadoc. Especially the package documentation with the quick start is well written.




回答10:


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.




回答11:


If all your looking for is the syntax, then this may help:

How to Write Doc Comments for the Javadoc Tool



来源:https://stackoverflow.com/questions/1079713/good-example-of-javadoc

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