当前位置:   article > 正文

Java文件模板设置小常识_创建一个java文件的时候设置文件头模板

创建一个java文件的时候设置文件头模板

有用的网址:

https://lanhuapp.com/
https://jar-download.com/ 
https://docs.oracle.com/javase/7/docs/api/
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/tip/src/share/classes/java 

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

/**
 * 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 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/423666
推荐阅读
相关标签
  

闽ICP备14008679号