Eclipse自定义注释
观前提示:
本文所使用的Eclipse版本为Photon Release (4.8.0)。
在使用Eclipse过程中,我们经常会使用到注释(类注释,方法注释……),但是每一次都手动添加@ClassName@Description这些自定义注释又会显得过于麻烦,这个时候,我们便可以自定义这些模板。
选择Window->Preferences
选择Java->Code Style->Code Templates自定义模板
1.文件(Flies)注释
选择Comments->Files->Edit
改写为以下内容
/**
* All rights Reserved, Designed By 公司名
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}(用一句话描述该文件做什么)
* @author: XXX
* @date: ${date} ${time}
* @version V1.0
* @Copyright: ${year} 公司名 Inc. All rights reserved.
*/
2.类型(Types)注释
选择Comment