竭诚为您提供优质文档/双击可除
myeclipse,注解模板
篇一:myeclipse中设置java注释模板的方法 设置jaVa注释模板 找到注释模板所在的地方:
windowpreferencejavacodestylecodetemplate然后展开comments节点就是所需要设置注释的元素了: 文件(Files)注释标签: /**
*@project:${project_name} *@title:${file_name} *@package${package_name} *@description:${todo}
*@authorshenyanghongahong20xx@gmail.com *@date${date}${time} *@copyright:${year} *@versionV1.0 */
类(types)注释标签(类的注释):
第 1 页 共 17 页
/**
*@classname${type_name} *@description${todo}
*@authorshenyanghongahong20xx@gmail.com *@date${date} *${tags} */
字段(Fields)注释标签: /**
*@Fields${field}:${todo} */
构造函数标签: /**
* title:
* description:
*${tags} */
方法(constructor&methods)标签: /**
*@title:${enclosing_method}
第 2 页 共 17 页
*@description:${todo} *@param${tags}
*@return${return_type} *@throws */
覆盖方法(overridingmethods)标签: /*(非javadoc)
* title:${enclosing_method}
* description:
*${tags}
*${see_to_overridden} */
代表方法(delegatemethods)标签: /** *${tags}
*${see_to_target} */
getter方法标签: /**
*@return${bare_field_name}
第 3 页 共 17 页
*/
setter方法标签: /**
*@param${param}要设置的${bare_field_name} */
简单模板例1:
context=\ption=\字段的注释
\lates.fieldcomment\ *@Fields${field}:${todo}(用一句话描述这个变量表示什么) */
id=\ment\ *@return${bare_field_name} */
id=\orcomment\
第 4 页 共 17 页
* title:${file_name}
* description:构造函数
*${tags} */
id=\nt\ *@title:${file_name} *@package${package_name}
*@description:${todo}(用一句话描述该文件做什么) *@authorjeffshawemail:jeff_chon@hotmail.com *@date${date}${time} *@versionV1.0 */
id=\ment\
*@param${param}要设置的${bare_field_name} */
id=\
第 5 页 共 17 页