myeclipse中java註釋格式設置

Eclipse註釋規範模版總結

一、具體操作

(1)在eclipse中,打開Window->Preference->Java->Code Style->Code Template

(2)然後展開Comments節點就是所有需設置註釋的元素,參照下面註釋規範對應設置即可

二、註釋規範

1、文件(Files)註釋標籤

/**
 * FileName:         ${file_name}
 * @Description:     ${todo}
 * @author:            crane-yuan
 * @version            V1.0
 * Createdate:      ${date}     ${time}
 * Copyright:        Copyright(C) 2016-2017
 * Company           CY.
 * All rights Reserved, Designed By crane-yuan

 * Modification  History:
 * Date         Author        Version        Discription
 * ---------------------------------------------------------------------------
 * ${date}     crane-yuan       1.0             1.0

 * Why & What is modified:
 */


2、類型(Types)註釋標籤(類的註釋):

/**
 * @ClassName:       ${type_name}
 * @Description:    ${todo}
 * @author:            crane-yuan
 * @date:            ${date}        ${time} 
 */

 
3、字段(Fields)註釋標籤:

/**  
  * @Fields ${field} :            ${todo}  
  */

 
4、構造函數(Constructor)註釋標籤:

/**
 * @Title:            ${enclosing_type}
 * @Description:    ${todo}
 * @param:            ${tags}
 * @throws
 */


5、方法(Methods)標籤:

/**
 * @Title:             ${enclosing_method}
 * @Description:     ${todo}
 * @param:             ${tags}   
 * @return:         ${return_type}   
 * @throws
 */

 
6、覆蓋方法(Overriding Methods)標籤:

/**
 * <p>Title: ${enclosing_method}</p>
 * <p>Description: </p>
 * ${tags}
 * ${see_to_overridden} 
 */

 
7、代表方法(Delegate Methods)標籤:

/**
 * ${tags}
 * ${see_to_target} 
 */


8、getter方法標籤:

/**
 * @Title:            ${enclosing_method} <BR>
 * @Description:      ${todo} <BR>
 * @return:         ${field_type} <BR> 
 */

 
9、setter方法標籤:

/**
 * @Title:          ${enclosing_method} <BR>
 * @Description:     ${todo} <BR>
 * @return:         ${field_type} <BR> 
 */
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章