Idea設(shè)置類注釋和方法注釋模板

設(shè)置類注釋

  1. Ctrl + Alt + S
  2. Editor -> File and Code Templates -> Includes
  3. 新增加一個(gè)File Header
  4. 配置如下:
/**
 * <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è)置方法注釋

  1. Ctrl + Alt + S
  2. Editor -> Live Templates
  3. 新增一個(gè)Template Group,如圖


    image.png
  4. 新增一個(gè)mc的live template,如圖


    image.png
  5. 具體模板,如下:
/**
* Description <br> 
* 
* @author Sunny <br>
* @taskId <br>
* @param $METHOD_PARAM$ <br>
* @createDate $Date$ $Time$<br>
**/
image.png
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容