Eclipse自动生成注释,修改注释模板

以下学习过程中的笔记,部分内容来自网络和书籍。一方便以后查阅,二希望能帮助到别人,三希望高手指点。 

用Myeclipse开发项目是,自动生成注释十分方便快捷,但我们希望自动生成自己的名字和一些内容,同时团队开发过程中会出现每个人注释格式不一致等问题。 
下面介绍如果通过修改Myeclipse注解模板解决问题。 


本人Myeclipse常用的设置,可按需要作相应修改 
----------------------------------------------------- 
1. 类的版权注释格式及设置步骤方式: 
Eclipse -> Window -> Preferences -> Java -> Code Style -> Code Templates -> Code  -> New Java files  -> Edit 
Java代码   收藏代码
  1. /*   
  2.  * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.   
  3.  *   
  4.  * This software is the confidential and proprietary information of   
  5.  * Founder. You shall not disclose such Confidential Information   
  6.  * and shall use it only in accordance with the terms of the agreements   
  7.  * you entered into with Founder.   
  8.  *   
  9.  */     
  10. ${filecomment}    
  11. ${package_declaration}    
  12.     
  13. ${typecomment}    
  14. ${type_declaration}   


2.类的注释格式及设置步骤如下: 
Eclipse -> Window -> Preferences -> Java -> Code Style -> Code Templates -> Comments -> Types -> Edit 
Java代码   收藏代码
  1. /**   
  2.  * This class is used for ...   
  3.  * @author jseven1989  
  4.  * @version   
  5.  *       1.0, ${date} ${time}   
  6.  */     


3.类的方法注释格式设置方式: 
Eclipse -> Window -> Preferences -> Java -> Code Style -> Code Templates -> Comments -> Methods -> Edit 
Java代码   收藏代码
  1. /**  
  2.  * ${tags}  
  3.  * @author jseven1989  
  4.  */    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值