最近开发的项目使用的注释比较多,所以网上查了一下资料,把eclipse这个工具添加注释的方法给分享了吧!
1、针对方法的注释:
Window > Preferences > Java > Code Style > Code Templates 选中右侧的 Methods 点击 Edit 将下面的添加即可
/**
*${tags}
*@author xxxx
*@date ${date} ${time}
*@comment
*/
@author 作者 @date系统时间 去系统当前时间 @comment代码说明
*@author ${user}
*@date ${date} ${time}
*@comment
1、针对方法的注释:
Window > Preferences > Java > Code Style > Code Templates 选中右侧的 Methods 点击 Edit 将下面的添加即可
/**
*${tags}
*@author xxxx
*@date ${date} ${time}
*@comment
*/
@author 作者 @date系统时间 去系统当前时间 @comment代码说明
在方法上面敲入/**按回车会自动将上面的填写到注释中。
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="false" context="methodcomment_context" deleted="false" description="Comment for non-overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name="methodcomment">/**
*${tags}*@author ${user}
*@date ${date} ${time}
*@comment
*/</template>
</templates>