建立 java 檔案的時候,選擇 "Generate comments" ,就會自動建立注釋
(點擊 "properties" , 取消 Enable project specific settings 選項,否則 @version version 不能顯示)
設定完成之後,可以匯出,便於下次使用.
具體設定如下
windows->preferences->java->code templates
Comments -> Files:
/**
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}(用一句話描述該檔案做什麼)
* @author A18ccms A18ccms_gmail_com
* @date ${date} ${time}
* @version V1.0
*/
Comments -> Types:(類的注釋):
/**
* @ClassName: ${type_name}
* @Description: ${todo}(這裡用一句話描述這個類的作用)
* @author A18ccms a18ccms_gmail_com
* @date ${date} ${time}
*
* ${tags}
*/
Comments -> Fileds::
/**
* @Fields ${field} : ${todo}(用一句話描述這個變數表示什麼)
*/
Comments -> Constructors::
/**
* <p>Title: </p>
* <p>Description: </p>
* ${tags}
*/
Comments -> Methods::
/**
* @Title: ${enclosing_method}
* @Description: ${todo}(這裡用一句話描述這個方法的作用)
* @param ${tags} 設定檔案
* @return ${return_type} 傳回型別
* @throws
*/
Comments -> Overriding methods::
/* (非 Javadoc)
* <p>Title: ${enclosing_method}</p>
* <p>Description: </p>
* ${tags}
* ${see_to_overridden}
*/
Comments -> Delegate methods::
/**
* ${tags}
* ${see_to_target}
*/
Comments -> Getters:
/**
* @return ${bare_field_name}
*/
Comments -> Setters::
/**
* @param ${param} 要設定的 ${bare_field_name}
*/
Code-> New Java files::
${filecomment}
${package_declaration}
/**
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}(添加描述)
* @author A18ccms A18ccms_gmail_com
* @date ${date} ${time}
* @version V1.0
*/
${typecomment}
${type_declaration}