参考:http://www.w3school.com.cn/tags/tag_pre.asp

javadoc 生成帮助文档时,注意以下几点:

1、函数功能描述的结尾一定要有句号,英文句号或中文句号均可。不然会有方法摘要里会出现后边一大片内容。

2、换行用<p>

3、<pre> 元素可定义预格式化的文本。被包围在 pre 元素中的文本通常会保留空格和换行符。而文本也会呈现为等宽字体。

  1. public class JavadocDemo
  2. {
  3.   /**
  4.    * 这个函数的功能是返回你输入的字符串.
  5.    * <p>
  6.    * 用法如下:
  7.    * <blockquote>
  8.    * <pre>
  9.    * String str = func("this is a test");
  10.    * System.out.println(str);
  11.    * </pre></blockquote>
  12.    * @param str 输入字符串.
  13.    * @return 返回字符串
  14.    */
  15.   public static String func(String str)
  16.   {
  17.     return str;
  18.   }
  19. }

生成的帮助文档如下

参考

1、参考java源码的Object类wait()方法

  1. /**
  2. * Causes the current thread to wait until another thread invokes the
  3. * {@link java.lang.Object#notify()} method or the
  4. * {@link java.lang.Object#notifyAll()} method for this object, or
  5. * some other thread interrupts the current thread, or a certain
  6. * amount of real time has elapsed.
  7. * <p>
  8. * This method is similar to the {@code wait} method of one
  9. * argument, but it allows finer control over the amount of time to
  10. * wait for a notification before giving up. The amount of real time,
  11. * measured in nanoseconds, is given by:
  12. * <blockquote>
  13. * <pre>
  14. * 1000000*timeout+nanos</pre></blockquote>
  15. * <p>
  16. * In all other respects, this method does the same thing as the
  17. * method {@link #wait(long)} of one argument. In particular,
  18. * {@code wait(0, 0)} means the same thing as {@code wait(0)}.
  19. * <p>
  20. * The current thread must own this object's monitor. The thread
  21. * releases ownership of this monitor and waits until either of the
  22. * following two conditions has occurred:
  23. * <ul>
  24. * <li>Another thread notifies threads waiting on this object's monitor
  25. * to wake up either through a call to the {@code notify} method
  26. * or the {@code notifyAll} method.
  27. * <li>The timeout period, specified by {@code timeout}
  28. * milliseconds plus {@code nanos} nanoseconds arguments, has
  29. * elapsed.
  30. * </ul>
  31. * <p>
  32. * The thread then waits until it can re-obtain ownership of the
  33. * monitor and resumes execution.
  34. * <p>
  35. * As in the one argument version, interrupts and spurious wakeups are
  36. * possible, and this method should always be used in a loop:
  37. * <pre>
  38. * synchronized (obj) {
  39. * while (&lt;condition does not hold&gt;)
  40. * obj.wait(timeout, nanos);
  41. * ... // Perform action appropriate to condition
  42. * }
  43. * </pre>
  44. * This method should only be called by a thread that is the owner
  45. * of this object's monitor. See the {@code notify} method for a
  46. * description of the ways in which a thread can become the owner of
  47. * a monitor.
  48. *
  49. * @param timeout the maximum time to wait in milliseconds.
  50. * @param nanos additional time, in nanoseconds range
  51. * 0-999999.
  52. * @throws IllegalArgumentException if the value of timeout is
  53. * negative or the value of nanos is
  54. * not in the range 0-999999.
  55. * @throws IllegalMonitorStateException if the current thread is not
  56. * the owner of this object's monitor.
  57. * @throws InterruptedException if any thread interrupted the
  58. * current thread before or while the current thread
  59. * was waiting for a notification. The <i>interrupted
  60. * status</i> of the current thread is cleared when
  61. * this exception is thrown.
  62. */
  63. public final void wait(long timeout, int nanos) throws InterruptedException {
  64. if (timeout < 0) {
  65. throw new IllegalArgumentException("timeout value is negative");
  66. }
  67.  
  68. if (nanos < 0 || nanos > 999999) {
  69. throw new IllegalArgumentException(
  70. "nanosecond timeout value out of range");
  71. }
  72.  
  73. if (nanos > 0) {
  74. timeout++;
  75. }
  76.  
  77. wait(timeout);
  78. }

2、>>Html标签定义<<

javadoc 生成帮助文档时,注意以下几点的更多相关文章

  1. 用JavaDoc生成项目文档

    项目到了尾声,大家都开始头疼——又要写文档了……是的,我们大多数人都不是从正规的Programer训练出来的.当初学习编程序的时候,就从来没有想过要给自己写的那几个程序编写一份完整的文档,所有的注释都 ...

  2. 如何在使用itext生成pdf文档时给文档添加背景图片

    这个问题我在网上搜了很久,没有找到什么解决方案,需求其实很简单,就是添加背景图片.在解决这个问题之前,我们需要了解什么是背景图片?背景图片就是位于文档最底层的图片,文字和其他内容可以浮在它的上面.这又 ...

  3. C# 在根据窗体中的表格数据生成word文档时出错

    出错内容为:

  4. WebService生成XML文档时出错。不应是类型XXXX。使用XmlInclude或SoapInclude属性静态指定非已知的类型。

    情况是SingleRoom和DoubleRoom是Room类的子类.在WebService中有一个方法是返回Room类. public Room Get(int roomId) { return Ro ...

  5. 生成 XML 文档时出错。

    找来找去,在CSDN 里看到高手解答了. 原来 WebService 传递参数时,不能使用 DataTable 如果需要使用DataTable  那就要用 DataSet  包装起来. 如果担心数据太 ...

  6. 使用Java生成word文档(附源码)

    当我们使用Java生成word文档时,通常首先会想到iText和POI,这是因为我们习惯了使用这两种方法操作Excel,自然而然的也想使用这种生成word文档.但是当我们需要动态生成word时,通常不 ...

  7. eclipse中javadoc给项目生成api文档

    步骤 1.打开java代码,编写JavaDoc 注释,只有按照java的规范编写注释,才能很好的生成API文档,javadoc注释与普通注释的区别为多一个*(星号).普通代码注释为/*XXX*/,而j ...

  8. eclipse如何为java项目生成API文档、JavaDoc

    当我们的项目很大,编写了很多代码的时候,就需要生成一个标准的API文档,让后续的开发人员,或者合作者可以清晰的了解您方法的使用,那么如何将自己的项目生成API文档呢? 1.点击eclipse的[Pro ...

  9. 如何用JavaDoc命令生成帮助文档

    如何用JavaDoc命令生成帮助文档 文档注释 在代码中使用文档注释的方法 /** *@author *@version * */ 生成帮助文档 打开java文件所在位置,在路径前加入cmd (注意有 ...

随机推荐

  1. hdu 1011 Starship Troopers_树状dp

    题目链接 题意:给你一棵树(必须从根节点出发),每个节点上都有bug和value,你有m个骑士,每个骑士能消灭20个bug,你必须消灭该节点的全部bug才能拿到该节点的value,问最多能拿到valu ...

  2. 【HDU3371】Connect the Cities(MST基础题)

    注意输入的数据分别是做什么的就好.还有,以下代码用C++交可以过,而且是500+ms,但是用g++就会TLE,很奇怪. #include <iostream> #include <c ...

  3. vim 的配色方案

    浅色: http://www.vimninjas.com/2012/09/14/10-light-colors/ 深色: http://www.vimninjas.com/2012/08/26/10- ...

  4. DoTween学习笔记(二) UGUI结合使用(实现一些简单效果)

    UGUI官方实例中是使用Animation来控制UI的移动,放大缩小动画等等, Animation来控制UI的动画工作量实在是太多了, 所以我们一般使用itween,DoTween. 来控制动画, 这 ...

  5. UITextField输入长度限制

    [_yourTextField addTarget:self action:@selector(eventEditingChange:) forControlEvents:UIControlEvent ...

  6. kaggle之识别谷歌街景图片中的字母

    https://github.com/lijingpeng/kaggle/tree/master/competitions/image_recognize 识别谷歌街景图片中的字母 street-vi ...

  7. ORACLE 视图的 with check option

    ORACLE 视图的 with check option 我们来看下面的例子: create or replace view testview as select empno,ename from e ...

  8. 黑马程序员 ——Java SE(1)

    ----<a href="http://www.itheima.com" target="blank">Java培训.Android培训.iOS培训 ...

  9. MFC让控件随窗口大小而改变

    转载自http://blog.csdn.net/chw1989/article/details/7488711 大小和位置都改变(亲测可行) 1.首先为窗体类添加CRect m_rect,该成员变量用 ...

  10. python调webservice和COM接口

    调webservice # -*- coding: cp936 -*- from suds.client import Client url = 'http://192.168.50.165/port ...