Kxgx.com - 移动开发网

本站快讯:
搜索: 您的位置主页>参考源码>软件源码>>阅读源码:编写注释生成javadoc HTML文档

编写注释生成javadoc HTML文档

2006-02-16   来源:   作者:未知   【 】 评论:0条

演示如何编写注释以便使用javadoc生成标准的javadoc HTML说明文档。

 

/**
 * The <code>Bar</code> component doesn't do much of anything. It is just
 * meant to demonstrate javadoc.
 <p>
 
 @version 2.4
 @author John Zukowski
 */


public class Bar {

  /**
   * A specific type of foo
   */
  public static final int FOO_TYPE = 0;

  /**
   * Another specific type of foo
   */
  public static final int ANOTHER_FOO_TYPE = 1;


  /**
   * The current foo type
   */
  private int type;

  /**
   * Constructs a Bar
   */
  public Bar() {
    type = FOO_TYPE;
  }

  /**
   * Returns current foo type
   
   @return current foo type
   @deprecated As of version 2.3, use {@link #getFoo() getFoo()}instead
   */
  public int foo() {
    return getFoo();
  }

  /**
   * Returns current foo type
   
   @return current foo type
   @since V2.3
   */
  public int getFoo() {

    return getFoo();
  }

  /**
   * Changes current foo type
   
   @param type
   *            new type of foo
   @throws IllegalArgumentException
   *             When type invalid
   */
  public void setFoo(int newValue) {
    if ((newValue != FOO_TYPE&& (newValue != ANOTHER_FOO_TYPE)) {
      throw new IllegalArgumentException("Bad type");


    }
    type = newValue;
  }

  /**
   * Placeholder method for see tags
   
   @see Bar#FOO_TYPE
   @see Bar#getFoo()
   @see #getFoo()
   @see "My Book"
   @see <a href="http://www.jguru.com">jGuru </a>
   */
  public void myVoid() {
  }

}

Tags:  
责任编辑:
  • 请文明参与讨论,禁止漫骂攻击。 用户名:新注册)密码:匿名:
    评论总数:0 [ 查看全部 ] 网友评论
    关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 帮助