Skip to content

IdeaJavaCodeCommentTemplate

CoderDream edited this page Apr 8, 2022 · 2 revisions

IdeaJavaCodeCommentTemplate.jar ├─fileTemplates │ │ Singleton.java │ │
│ ├─includes │ │ File Header.java │ │
│ └─internal │ AnnotationType.java │ Class.java │ Enum.java │ Interface.java │
└─templates custom.xml

Singleton.java #if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end

#if (${IMPORT_BLOCK} != "")${IMPORT_BLOCK} #end #parse("File Header.java") #if (${VISIBILITY} == "PUBLIC")public #end class ${NAME} #if (${SUPERCLASS} != "")extends ${SUPERCLASS} #end #if (${INTERFACES} != "")implements ${INTERFACES} #end { private static final ${NAME} ourInstance = new ${NAME}();

#if (${VISIBILITY} == "PUBLIC")public #end static ${NAME} getInstance() {
    return ourInstance;
}

private ${NAME}() {
}

}

File Header.java /**

  • 功能描述
  • @since ${YEAR}-${MONTH}-${DAY} */

AnnotationType.java #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse("File Header.java") public @interface ${NAME} { }

Class.java #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse("File Header.java") public class ${NAME} { }

Enum.java #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse("File Header.java") public enum ${NAME} { }

Interface.java #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse("File Header.java") public interface ${NAME} { }