Eclipse注释模板

网上的Eclipse注释模板,在这里稍稍整理一些比较常用的。

编辑注释模板的方法:Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素啦。现就每一个元素逐一介绍:

1.文件(Files)注释标签:

  1. /**  
  2.  * All rights Reserved, Designed By Android_Robot   
  3.  * @Title:  ${file_name}   
  4.  * @Package ${package_name}   
  5.  * @Description:    ${todo}(用一句话描述该文件做什么)   
  6.  * @author: Android_Robot     
  7.  * @date:   ${date} ${time}   
  8.  * @version V1.0     
  9.  */  


2.类型(Types)注释标签(类的注释):

  1. /**   
  2.  * @ClassName:  ${type_name}   
  3.  * @Description:${todo}(这里用一句话描述这个类的作用)   
  4.  * @author: Android_Robot  
  5.  * @date:   ${date} ${time}   
  6.  *   
  7.  * ${tags}   
  8.  */  


3.字段(Fields)注释标签:

  1. /**   
  2.  * @Fields ${field} : ${todo}(用一句话描述这个变量表示什么)   
  3.  */   


4.构造函数标签:

  1. /**   
  2.  * @Title:  ${enclosing_type}   
  3.  * @Description:    ${todo}(这里用一句话描述这个方法的作用)   
  4.  * @param:  ${tags}  
  5.  * @throws   
  6.  */  


5.方法(Methods)标签:

  1. /**   
  2.  * @Title: ${enclosing_method}   
  3.  * @Description: ${todo}(这里用一句话描述这个方法的作用)   
  4.  * @param: ${tags}      
  5.  * @return: ${return_type}      
  6.  * @throws   
  7.  */  

6.覆盖方法(Overriding Methods)标签:

  1. /**   
  2.  * <p>Title: ${enclosing_method}</p>   
  3.  * <p>Description: </p>   
  4.  * ${tags}   
  5.  * ${see_to_overridden}   
  6.  */  


7.代表方法(Delegate Methods)标签:

  1. /**  
  2.  * ${tags}  
  3.  * ${see_to_target}  
  4.  */  


8.getter方法标签:

  1. /**  
  2.  * @Title:  ${enclosing_method} <BR>  
  3.  * @Description: please write your description <BR>  
  4.  * @return: ${field_type} <BR>  
  5.  */  


9.setter方法标签:

  1. /**  
  2.  * @Title:  ${enclosing_method} <BR>  
  3.  * @Description: please write your description <BR>  
  4.  * @return: ${field_type} <BR>  
  5.  */  


剩下的就默认了,^_^

原文地址:https://www.cnblogs.com/dsliang/p/5124072.html