IDEA JAVA模板定义

  • Post author:
  • Post category:java



IDEA JAVA模板定义



1、Settings->File and Code Templates

Includes标签下

点击加号,添加文件,重命名为:File Header

添加内容为:

 /**
 * 
 * ${DESCRIPTION}
 *
 * @author ${USER}
 * @version 1.0
 * @date ${YEAR}-${MONTH}-${DAY} ${TIME}
 */



2、Settings->File and Code Templates

Files标签下

Class修改为:

/* Copyright © 2020 Yuech and/or its affiliates. All rights reserved. */
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public class ${NAME} {
}

Interface修改为:

/* Copyright © 2020 Yuech and/or its affiliates. All rights reserved. */
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public interface ${NAME} {
}

Enum修改为:

/* Copyright © 2020 Yuech and/or its affiliates. All rights reserved. */
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public @interface ${NAME} {
}

AnnotationType修改为:

/* Copyright © 2020 Yuech and/or its affiliates. All rights reserved. */
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public @interface ${NAME} {
}



3、新建java代码时,填写类注释到弹出的DESCRIPTION框中



版权声明:本文为yuechang5原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。