Eclipse 注释模板

设置注释模板的入口:Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素。每个元素解释如下:

Files 文件的注释

/**
 * @Title: ${file_name}  
 * @Package: ${package_name}  
 * @Date: ${date}
 * @Author: ${user}
 * @Description: ${todo}
 */

Types 类的注释

/**
* @ClassName: ${type_name}  
 * @Author: ${user}
 * @Date: ${date}
 * ${tags}
 */

Fields 字段的注释

/**
 * @Fields field:field:{todo}
 */

Constructor 构造函数的注释

/**  
* 创建一个新的实例 ${enclosing_type}.  
*  
* ${tags}  
*/

Method 方法的注释

/**  
* @Title: ${enclosing_method}  
* @Description: ${todo}
* @Params: ${tags}      
* @Return: ${return_type}      
* @Throws    
*/

Overriding Methods 覆盖方法的注释

/* (non-Javadoc)
 * @Title: ${enclosing_method}
 * @Description: ${todo}
 * ${tags}  
 * ${see_to_overridden} 
 */

Delegate Methods 代理方法的注释

/**
 * ${tags}
 * ${see_to_target}
 */

Getters 注释

/**
 * @return the ${bare_field_name}
 */

Setters 注释

/**
 * @param ${param} the ${bare_field_name} to set
 */

配置好之后,可以通过Window->Preference->Java->Code Style->Code Template >Export ALL 导出xml,以后就可以通过 Import导入了。

如上的配置文件已经传至githubhttps://github.com/Yao544303/config

Reference

1.http://blog.csdn.net/paul342/article/details/52982585

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值