MyEclipse注释配置

MyEclipse注释配置

  1. 配置路径

1.1.      JAVA

      打开MyEclipse,选择Window>Preferences>Java>Code Style>Code Templates>Comments.

1.2.      JS

      打开MyEclipse,选择Window>Preferences>MyEclipse>Files and Editors>JavaScript> Code Style> Code Templates>Comments.

  1. 配置说明

2.1.      Files(类文件注释)

l  使用范围

      对class文件进行说明。

l  触发机制

      新建class文件时触发,增加在class文件最顶部。

l  配置内容

/*

 * @title: ${file_name}

 * @package:${package_name}

 * @description:${todo}

 * @author: Li_Zhenzhong@founder.com

 * @date: ${date} ${time}

 * @version:V1.0

 */

l  配置说明

title: 文件名称;

package:文件所在报名;

description:文件功能描述;

author:作者;

date:创建时间;

version:版本;

     

2.2.      Types(类注释)

l  使用范围

      对class类进行说明。

l  触发机制:

      在class类方法前使用:”/**“+回车。

l  配置内容:

/**

 * @className: ${type_name}

 * @description:${todo}

 * @author: Li_Zhenzhong@founder.com

 * @date: ${date} ${time}

 * ${tags}

 */

l  配置说明:

className: 类名称;

description:文件功能描述;

author:作者;

date:创建时间;

2.3.      Fields(变量注释)

l  使用范围

      对类中的变量进行注释。

l  触发机制:

l  配置内容:

/**

 * @fields ${field} ${field_type} :${todo}

 */

l  配置说明:

fields: 变量名称,类型:作用;

2.4.      Methods(方法注释)

l  使用范围

      对class类中的方法进行说明。

l  触发机制:

      在方法前使用:”/**“+回车。

l  配置内容:

/**

 * @title: ${enclosing_method}

 * @description:${todo}

 * @author: Li_Zhenzhong@founder.com

 * ${tags}

 * @date:${date}${time}

 */

l  配置说明:

title:方法名

description:文件功能描述;

author:作者;

* ${tags} ${return_type}:参数和返回值类型

date:创建时间;

throws:抛出哪些异常

2.5.      Overriding Methods(方法注释)

l  使用范围

      对class类中的方法进行重写的方法进行说明。

l  触发机制:

      在方法前使用:”@ Overriding“。

l  配置内容:

/**

 * @title: ${enclosing_method}

 * @description:${todo}

 * @author: Li_Zhenzhong@founder.com

 * ${tags}

 * @date:${date}${time}

 */

l  配置说明:

title:方法名

description:文件功能描述;

author:作者;

* ${tags} ${return_type}:参数和返回值类型

date:创建时间;

throws:抛出哪些异常

 

原文地址:https://www.cnblogs.com/meimao5211/p/3605470.html