Android Studio、IntelliJ IDEA 、 Java文件模板设置小常识

版权声明:本文出自门心叼龙的博客,转载请注明出处。 https://blog.csdn.net/geduo_83/article/details/86539646

我们在写代码的时候,文件头都会有文件的描述、作者、时间、版本等信息,例如下面就是一个标准的文件头模板

/**
 * Description: <${NAME}><br>
 * Author:      ${USER}<br>
 * Date:        ${DATE}<br>
 * Version:     V1.0.0<br>
 * Update:     <br>
 */ 

模板里面的配置的变量都有以下:

Variable

Description

${DATE}

Current system date

${DAY}

Current day of the month

${DS}

Dollar sign ($). This variable is used to escape the dollar character, so that it is not treated as a prefix of a template variable.

${END}

Caret position after you finish editing the variables

${FILE_NAME}

Name of the new PHP file (if the PHP plugin is enabled)

${HOUR}

Current hour

${MINUTE}

Current minute

${MONTH}

Current month

${MONTH_NAME_FULL}

Full name of the current month (January, February, etc.)

${MONTH_NAME_SHORT}

First three letters of the current month name (Jan, Feb, etc.)

${NAME}

Name of the new entity (file, class, interface, and so on)

${PACKAGE_NAME}

Name of the target package where the new class or interface file is created

${PRODUCT_NAME}

Name of the IDE (for example, IntelliJ IDEA)

${PROJECT_NAME}

Name of the current project

${TIME}

Current system time

${USER}

Login name of the current user

${YEAR}

Current year

更多用法请参阅:

https://www.jetbrains.com/help/idea/file-template-variables.html 

猜你喜欢

转载自blog.csdn.net/geduo_83/article/details/86539646
今日推荐