服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > JAVA > 新手入门 > 基础入门 > 查看文档

编写注释生成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() {
  }

}

扫描关注微信公众号