|
Android Studio 生成class自动添加注释
Android Studio 生成类自动添加注释
File=>setting (快捷键 ctrl + Alt + S) =>Editor => File and Code Templates
这里就可以设置一个自动类注释
- /**
- * @Description TODO
- * @systemUser ${USER}
- * @Author ${CreatePerson}
- * @Date ${MONTH}-${DAY}-${YEAR} ${DAY_NAME_SHORT} ${TIME}
- */
复制代码
创建好了之后就可以看到美丽的自动生成注释,
还可以使用更多自定义来设置自己喜欢的生成注释
expanded like macros into the corresponding values.
Predefined variables will take the following values:
${PACKAGE_NAME}
name of the package in which the new file is created
生成项目包名注释
${USER}
current user system login name
生成系统用户名
${DATE}
current system date
系统日期格式为 2021/9/16
${TIME}
current system time
系统时间格式为 9:10
${YEAR}
current year
单独出现 2021
${MONTH}
current month
单独出现 09
${MONTH_NAME_SHORT}
first 3 letters of the current month name. Example: Jan, Feb, etc.
单独出现 9月
${MONTH_NAME_FULL}
full name of the current month. Example: January, February, etc.
单独出现 九月
${DAY}
current day of the month
单独出现 16
${DAY_NAME_SHORT}
first 3 letters of the current day name. Example: Mon, Tue, etc.
单独出现 16日
${DAY_NAME_FULL}
full name of the current day. Example: Monday, Tuesday, etc.
单独出现 十六日
${HOUR}
current hour
单独出现 9
${MINUTE}
current minute
单独出现 16
${PROJECT_NAME}
the name of the current project
生成项目名称
Apache Velocity template language is used
使用这些语言,不迷路,玩耍更多的注释技巧
|
|