設(shè)置類注釋
- Ctrl + Alt + S
- Editor -> File and Code Templates -> Includes
- 新增加一個(gè)File Header
- 配置如下:
/**
* <Description> <br>
*
* @author Sunny<br>
* @taskId: <br>
* @version 1.0<br>
* @createDate ${YEAR}/${MONTH}/${DAY} ${TIME} <br>
* @see ${PACKAGE_NAME} <br>
*/
Idea 支持的變量
This is a built-in template. It contains a code fragment that can be included into file templates (Templates tab) with the help of the #parse directive.
The template is editable. Along with static text, code and comments, you can also use predefined variables that will then be 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
${TIME} current system time
${YEAR} current year
${MONTH} current month
${MONTH_NAME_SHORT} first 3 letters of the current month name. Example: Jan, Feb, etc.
${MONTH_NAME_FULL} full name of the current month. Example: January, February, etc.
${DAY} current day of the month
${HOUR} current hour
${MINUTE} current minute
${PROJECT_NAME} the name of the current project
設(shè)置方法注釋
- Ctrl + Alt + S
- Editor -> Live Templates
-
新增一個(gè)Template Group,如圖
image.png -
新增一個(gè)mc的live template,如圖
image.png - 具體模板,如下:
/**
* Description <br>
*
* @author Sunny <br>
* @taskId <br>
* @param $METHOD_PARAM$ <br>
* @createDate $Date$ $Time$<br>
**/

image.png

