设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素啦。现就每一个元素逐一介绍:?
文件(Files)注释标签:?
/**???
* @Title: ${file_name}?
* @Package ${package_name}?
* @Description: ${todo}(用一句话描述该文件做什么)?
* @author A18ccms A18ccms_gmail_com???
* @date ${date} ${time}?
* @version V1.0???
*/?
类型(Types)注释标签(类的注释):?
/**?
* @ClassName: ${type_name}?
* @Description: ${todo}(这里用一句话描述这个类的作用)?
* @author A18ccms a18ccms_gmail_com?
* @date ${date} ${time}?
*?
* ${tags}?
*/?
字段(Fields)注释标签:?
/**?
* @Fields ${field} : ${todo}(用一句话描述这个变量表示什么)?
*/?
构造函数标签:?
/**?
* <p>Title: </p>?
* <p>Description: </p>?
* ${tags}?
*/?
方法(Constructor & Methods)标签:?
/**?
* @Title: ${enclosing_method}?
* @Description: ${todo}(这里用一句话描述这个方法的作用)?
* @param ${tags}??? 设定文件?
* @return ${return_type}??? 返回类型?
* @throws?
*/?
覆盖方法(Overriding Methods)标签:?
/* (非 Javadoc)>??????????????? name="methodcomment">?
??? /**???
???? * 此方法描述的是:???
???? * @author: wangxiongdx@163.com???
???? * @version: ${date} ${time}???
???? */???
??? </template>?
??? <template????
??????????????? autoinsert="true"????
??????????????? context="delegatecomment_context"????
??????????????? deleted="false"????
??????????????? description="Comment for delegate methods"????
??????????????? enabled="true"????
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment"????
??????????????? name="delegatecomment">?
??? /**???
???? * ${tags}???
???? * ${see_to_target}???
???? */???
??? </template>?
??? <template?
??????????????? autoinsert="false"????
??????????????? context="filecomment_context"????
??????????????? deleted="false"????
??????????????? description="Comment for created Java files"????
??????????????? enabled="true"????
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.filecomment"????
??????????????? name="filecomment">?
??? /**???
???? * 文件名:${file_name}???
???? *???
???? * 版本信息:???
???? * 日期:${date}???
???? * Copyright 足下 Corporation ${year}????
???? * 版权所有???
???? *???
???? */???
??? </template>?
??? <template????
??????????????? autoinsert="false"????
??????????????? context="gettercomment_context"????
??????????????? deleted="false"????
??????????????? description="Comment for getter method"????
??????????????? enabled="true"????
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.gettercomment"????
??????????????? name="gettercomment">?
??? /**???
???? * ${bare_field_name}???
???? *???
???? * @return the ${bare_field_name}???
???? * @since?? CodingExample Ver(编码范例查看) 1.0???
??? */???
??? </template>?
??? <template????
??????????????? autoinsert="true"????
??????????????? context="overridecomment_context"????
??????????????? deleted="false"????
??????????????? description="Comment for overriding methods"????
??????????????? enabled="true"????
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.overridecomment"????
??????????????? name="overridecomment">?
??? /* (non-Javadoc)???
???? * ${see_to_overridden}???
???? */???
??? </template>?
??? <template????
??????????????? autoinsert="false"????
??????????????? context="fieldcomment_context"????
??????????????? deleted="false"????
??????????????? description="Comment for fields"????
??????????????? enabled="true"????
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment"????
??????????????? name="fieldcomment">?
??? /**???
???? * ${field}:${todo}(用一句话描述这个变量表示什么)???
???? *???
???? * @since Ver 1.1???
???? */???
??? </template>?
??? <template????
??????????????? autoinsert="false"????
??????????????? context="typecomment_context"????
??????????????? deleted="false"????
??????????????? description="Comment for created types"????
??????????????? enabled="true"????
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.typecomment"????
??????????????? name="typecomment">?
??? /**???
???? * 此类描述的是:???
???? * @author: wangxiongdx@163.com???
???? * @version: ${date} ${time}????
???? */???
??? </template>?
</templates>?
<?xml version="1.0" encoding="UTF-8"?>?
<templates>?
??? <template?
??????????????? autoinsert="false"?
????????????????? context="constructorcomment_context"?
??????????????? deleted="false"?
??????????????? description="Comment for created constructors"?
??????????????? enabled="true"?
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.constructorcomment"?
??????????????? name="constructorcomment">?
??? /**?
???? * 创建一个新的实例 ${enclosing_type}.?
???? *?
???? * ${tags}?
???? */?
??? </template>?
??? <template?
??????????????? autoinsert="true"?
??????????????? context="settercomment_context"?
??????????????? deleted="false"?
??????????????? description="Comment for setter method"?
??????????????? enabled="true"?
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.settercomment"?
??????????????? name="settercomment">?
??? /**?
???? * @param ${param} the ${bare_field_name} to set?
???? */?
??? </template>?
??? <template?
??????????????? autoinsert="false"?
??????????????? context="methodcomment_context"?
??????????????? deleted="false"?
??????????????? description="Comment for non-overriding methods"?
??????????????? enabled="true"?
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.methodcomment"?
??????????????? name="methodcomment">?
??? /**?
???? * 此方法描述的是:?
???? * @author: wangxiongdx@163.com?
???? * @version: ${date} ${time}?
???? */?
??? </template>?
??? <template?
??????????????? autoinsert="true"?
??????????????? context="delegatecomment_context"?
??????????????? deleted="false"?
??????????????? description="Comment for delegate methods"?
??????????????? enabled="true"?
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment"?
??????????????? name="delegatecomment">?
??? /**?
???? * ${tags}?
???? * ${see_to_target}?
???? */?
??? </template>?
??? <template?
??????????????? autoinsert="false"?
??????????????? context="filecomment_context"?
??????????????? deleted="false"?
??????????????? description="Comment for created Java files"?
??????????????? enabled="true"?
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.filecomment"?
??????????????? name="filecomment">?
??? /**?
???? * 文件名:${file_name}?
???? *?
???? * 版本信息:?
???? * 日期:${date}?
???? * Copyright 足下 Corporation ${year}?
???? * 版权所有?
???? *?
???? */?
??? </template>?
??? <template?
??????????????? autoinsert="false"?
??????????????? context="gettercomment_context"?
??????????????? deleted="false"?
??????????????? description="Comment for getter method"?
??????????????? enabled="true"?
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.gettercomment"?
??????????????? name="gettercomment">?
??? /**?
???? * ${bare_field_name}?
???? *?
???? * @return the ${bare_field_name}?
???? * @since?? CodingExample Ver(编码范例查看) 1.0?
??? */?
??? </template>?
??? <template?
??????????????? autoinsert="true"?
??????????????? context="overridecomment_context"?
??????????????? deleted="false"?
??????????????? description="Comment for overriding methods"?
??????????????? enabled="true"?
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.overridecomment"?
??????????????? name="overridecomment">?
??? /* (non-Javadoc)?
???? * ${see_to_overridden}?
???? */?
??? </template>?
??? <template?
??????????????? autoinsert="false"?
??????????????? context="fieldcomment_context"?
??????????????? deleted="false"?
??????????????? description="Comment for fields"?
??????????????? enabled="true"?
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment"?
??????????????? name="fieldcomment">?
??? /**?
???? * ${field}:${todo}(用一句话描述这个变量表示什么)?
???? *?
???? * @since Ver 1.1?
???? */?
??? </template>?
??? <template?
??????????????? autoinsert="false"?
??????????????? context="typecomment_context"?
??????????????? deleted="false"?
??????????????? description="Comment for created types"?
??????????????? enabled="true"?
??????????????? id="org.eclipse.jdt.ui.text.codetemplates.typecomment"?
??????????????? name="typecomment">?
??? /**?
???? * 此类描述的是:?
???? * @author: wangxiongdx@163.com?
???? * @version: ${date} ${time}?
???? */?
??? </template>?
</templates>?
详细解决方案
【工程轨范】Eclipse注释模板与规范
热度:63 发布时间:2016-04-23 01:52:26.0
相关解决方案
- eclipse struts2找不到action!调了一个晚下了
- Eclipse + Tomcat Debug時很慢,该怎么解决
- eclipse+tomcat6.0+oracle 10g配置数据库连接池的异常
- eclipse ee版本 怎么新建和发布 web project
- eclipse 运用URL连接出错,求解
- eclipse jee tomcat警告有关问题
- eclipse 提醒 configure build path
- !hadoop 0.21.0 eclipse 3.7 win7,点击run on hadoop报错
- JDBC MYSQL 驱动加载失败 JSP DAO ECLIPSE,该怎么解决
- Eclipse 报错org.apache.catalina.LifecycleException: Failed to start component。该怎么解决
- eclipse 老崩溃 错误异常如下
- Eclipse JSP调用Servlet的有关问题
- eclipse 怎么发布 Dynamic web project到Tomcat
- eclipse 经典版,最新稳定版是多少?解决方法
- 【文件分享】Eclipse Plug-in资料分享
- eclipse 在线安装 birt,该怎么解决
- 现下公司里开发用的 Eclipse + MyEclipse + Tomcat + JDK 都是什么版本的
- Eclipse plugin/RCP开发资料大整理
- 现时公司里开发用的 Eclipse + MyEclipse + Tomcat + JDK 都是什么版本的
- j2me eclipse antenna打包混合出错了,该怎么处理
- Eclipse + wtk下,如何加com.nokia.mid.ui
- Eclipse 混淆包错误有关问题
- Eclipse 调试 J2ME 出现有关问题了。
- eclipse 3.2中J2ME 开发配置有关问题
- eclipse wtk 2.2整和有关问题
- eclipse 集成 javaAPI 的有关问题
- eclipse class not found 愁死了解决方法
- eclipse 没法打包资源文件
- 急问:S60,eclipse,打开模拟器总是提示“unhandled exception.Close application?该如何解决
- 请教怎么在 Eclipse 中配置M3G 包以 支持 J2ME 的 3D 游戏开发?