在多人协作开发一个项目的时候,往往会对代码进行修改。但总和的代码块数量众多,如何快速的找到是谁写在什么时候写的就成了关键。接下来教大家的就是在新建类时的系统自动生成注释信息、作者、时间的方法。
设置信息:
File—>Settings—>Editor—>File and Code Templates
然后:
Includes—>File Header—>设置说明信息—>Apply
操作实例:
一
二
三
四
代码:
/**
*author: ${USER}
*创建时间:${DATE}
*Describe:
*/
除了添加以上的作者,日期外,还可以添加其他额外的信息,如下:
${PACKAGE_NAME} name of the package in which the new file is created
${USER} current user system login name
${TIME} current system time
${YEAR} current year
${DATE} current system date
${MONTH_NAME_SHORT} first 3 letters of the current month name
${MONTH_NAME_FULL} full name of the current month.
${MONTH} current month
${DAY} current day of the month
${HOUR} current hour
${MINUTE} current minute
${PROJECT_NAME} the name of the current project