背景

每次创建class、interface都需要手动写重复的注释,特繁琐重复操作,我通过创建自己的注释模版自动生成提高了工作效率。

模板方式步骤

图一

创建新建文件的时候自动生成模版代码

image.png

  1. /**
  2. * @author ${USER}
  3. * @since 1.0.0
  4. */

图二

手动输入/*+回车键自动生成

image.png

勾选在什么文件下使用生效

image.png

其他

官方描述内容可采用预定义变量取值

  1. Predefined variables will take the following values:
  2. ${PACKAGE_NAME}
  3. name of the package in which the new class is created
  4. ${NAME}
  5. name of the new class specified by you in the Create New Class dialog
  6. ${USER}
  7. current user system login name
  8. ${DATE}
  9. current system date
  10. ${TIME}
  11. current system time
  12. ${YEAR}
  13. current year
  14. ${MONTH}
  15. current month
  16. ${MONTH_NAME_SHORT}
  17. first 3 letters of the current month name. Example: Jan, Feb, etc.
  18. ${MONTH_NAME_FULL}
  19. full name of the current month. Example: January, February, etc.
  20. ${DAY}
  21. current day of the month
  22. ${HOUR}
  23. current hour
  24. ${MINUTE}
  25. current minute
  26. ${PROJECT_NAME}

参考记录

  1. https://www.cnblogs.com/yanh0606/p/11990863.html