开发人员代码注释规范
开发人员代码注释规范
Java类版权及代码注释
注释示例package java.blah;
import java.blah.blahdy.BlahBlah;
/*
* ==========================================================
* Version Author Date Description
* 1.0 huangzhihui 2007-11-05 创建
* ==========================================================
*/
/**
*
Title: Blah.java
*
Description:
*
Copyright: Copyright (c) 2009
*
Company: Eshore Technology Co.,Ltd.
* @author huangzhihui
*
*/
public class Blah extends SomeClass {
/** classVar1 documentation comment */
public static int classVar1;
//classVar2 documentation comment that happens to be
//more than one line long
private static Object classVar2;
/**
* ...constructor Blah documentation comment...
*/
public Blah() {
// ...implementation goes here...
}
/**
* ...method doSomething documentation comment...
*/
public void doSomething() {
// ...implementation goes here...
}
/**
* ...method doSomethingElse documentation comment...
*
detail description
*
*
another description
*
* @param someParam description
* @return return value description
* @throws SomeException exception SomeException description
*
* @see xx.xx.SomeClass#doSomethingElse(String)
*/
public SomeClass doSomethingElse(Object someParam) throws SomeExcetpion{
// ...implementation goes here...
}
}
打开MyEclipse,,Java(Code Style(Code Templates(Code(New Java file,点击右边的“Edit”,将下面的段落覆盖原文后保存。
${package_declaration}
/*
* ==========================================================
* Version Author Date Description
* 1.0 ${user} ${year}-${month}-${date}创建
* ==========================================================
*/
/**
*
Title: ${file_name}
*
Description:
*
Copyright: Copyright (c) ${year}
*
Company: Eshore Technology C