選擇 window-->Preferences-->JAVA-->Code-->Code Templates

選擇 Comments --> Files --> Edit

添加

/**  
 * Filename:    ${file_name}  
 * Description:   
 * Copyright:   Copyright (c)2009  
 * Company:    company 
 * @author:     alex  
 * @version:    1.0  
 * Create at:   ${date} ${time}  
 *  
 * Modification History:  
 * Date         Author      Version     Description  
 * ------------------------------------------------------------------  
 * ${date}    alex             1.0        1.0 Version  
 */  


Modification History: 每次修改版本,需要添加修改記錄和說明

將下面的 Automatically add comments for new methods and types 選中


選擇 Comments --> Methods --> Edit

添加

/**
 * {方法的功能/動作描述}
 * @param      {引入?yún)?shù)名}   {引入?yún)?shù)說明}
 * @return      {返回參數(shù)名}   {返回參數(shù)說明}
 * @exception   {說明在某情況下,將發(fā)生什么異常}
 */

這樣在新增java類文件時,可以自動加載注釋模板,生成后需要稍微調(diào)整一下注釋的位置。
對于方法注釋的添加,可以在要添加的注釋處,單擊右鍵 選擇 Source-->Generate Element Comment 即可生成方法注釋,填充注釋內(nèi)容