Eclipse编码模版设置

2019-04-15 17:46发布

http://andli.iteye.com/upload/picture/pic/100149/c68ebd2d-1109-3b74-aac0-83de7bc7ad4c.png   /**
* @author lilin
* @date ${date} ${time}
* @annotation
*/         Files /** * @author lilin * @date ${date} ${time} * @Title: ${file_name} * @Package ${package_name} * @Description: ${todo} * @version V1.0 */   Types /** * @author lilin * @date ${date} ${time} * @ClassName: ${type_name} * @Description: ${todo} * ${tags} */   Method /** * @author lilin * @date ${date} ${time} * @Title: ${enclosing_method} * @Description: ${todo} * @param ${tags} * @return ${return_type} * @throws */     设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素啦。现就每一个元素逐一介绍: 文件(Files)注释标签: /** * @Project: ${project_name} * @Title: ${file_name} * @Package ${package_name} * @Description: ${todo} * @author shenyanghong ahong2011@gmail.com * @date ${date} ${time} * @Copyright: ${year} www.1000chi.com Inc. All rights reserved. * @version V1.0 */ 类(Types)注释标签(类的注释): /** * @ClassName ${type_name} * @Description ${todo} * @author shenyanghong ahong2011@gmail.com * @date ${date} * ${tags} */ 字段(Fields)注释标签: /** * @Fields ${field} : ${todo} */ 构造函数标签: /** *

Title:

*

Description:

* ${tags} */ 方法(Constructor & Methods)标签: /** * @Title: ${enclosing_method} * @Description: ${todo} * @param ${tags} 设定文件 * @return ${return_type} 返回类型 * @throws */ 覆盖方法(Overriding Methods)标签: /* (非 Javadoc) *

Title: ${enclosing_method}

*

Description:

* ${tags} * ${see_to_overridden} */ 代表方法(Delegate Methods)标签: /** * ${tags} * ${see_to_target} */ getter方法标签: /** * @return ${bare_field_name} */ setter方法标签: /** * @param ${param} 要设置的 ${bare_field_name} */ 简单模板例1: