设置注释模板的入口: Window->Preference->Java->CodeStyle->Code Template 然后展开Comments节点就是所有需设置注释的元素啦。现就每一个元素逐一介绍:
选择以下的标签:
Files,Types.....
/**
* @Project: ${project_name}
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}
* @author shenyanghongahong2011@gmail.com
* @date ${date} ${time}
* @Copyright: ${year} www.1000chi.comInc. All rights reserved.
* @version V1.0
*/
类(Types)注释标签(类的注释):/**
* @ClassName ${type_name}
* @Description ${todo}
* @author shenyanghong ahong2011@gmail.com
* @date ${date}
* ${tags}
*/
字段(Fields)注释标签:/**
* @Fields ${field} : ${todo}
*/
构造函数标签:
/**
* @Description: ${todo}
* ${tags}
*/
方法(Constructor & Methods)标签:/**
* @Method: ${enclosing_method}
* @Description: ${todo}
* @param ${tags}
* @return ${return_type}
* @throws
*/
覆盖方法(Overriding Methods)标签:/**
* @Method: ${enclosing_method}
* @Description: ${todo}
* ${tags}
* ${see_to_overridden}
*/