编程习惯
新建 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}