Import block visibility abstract 自定义配置(AndroidStudio4.0)
程序员文章站
2024-02-29 12:13:46
...
版权声明:本文为延成原创文章,转载请标明出处
简单解释
- IMPORT BLOCK 导包
- VISIBILITY 值为PUBLIC或 PACKAGE_PRIVATE 或不填 分别对应public修饰符 - private 修饰符和没有修饰符
- FINAL 类是否加final修饰
- SUPERCLASS 指定父类
- INTERFACES 指定接口
配置自己的模板
- Class 模板自定义
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
#if(${not_public_1} != "1")public #end #if (${abstract_1} == "1")abstract #end #if (${final_1} == "1")final #end class ${NAME} #if (${superClass} != "")extends ${superClass} #end #if (${interfaces} != "")implements ${interfaces} #end {
}
- Interface 模板自定义
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
#if(${not_public_1} != "1")public #end interface ${NAME} #if (${extends} != "")extends ${extends} #end {
}
- Enum 模板自定义
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
#if(${not_public_1} != "1")public #end enum ${NAME} #if (${implements} != "")implements ${implements} #end {
}
- AnnotationType 模板自定义
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
#if(${not_public_1} != "1")public #end @interface ${NAME} #if (${extends} != "")extends ${extends} #end {
}
- Class 系统默认
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#if (${IMPORT_BLOCK} != "")${IMPORT_BLOCK}
#end
#parse("File Header.java")
#if (${VISIBILITY} == "public") public #end #if (${ABSTRACT} == "true")abstract #end #if (${FINAL} == "true")final #end class ${NAME} #if (${SUPERCLASS} != "")extends ${SUPERCLASS} #end #if (${INTERFACES} != "") implements ${INTERFACES} #end {
}
- Interface 系统默认
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#if (${IMPORT_BLOCK} != "")${IMPORT_BLOCK}
#end
#parse("File Header.java")
#if (${VISIBILITY} == "PUBLIC")public #end interface ${NAME} #if (${INTERFACES} != "")extends ${INTERFACES} #end {
}
- Enum 系统默认
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#if (${IMPORT_BLOCK} != "")${IMPORT_BLOCK}
#end
#parse("File Header.java")
#if (${VISIBILITY} == "PUBLIC")public #end enum ${NAME} #if (${INTERFACES} != "")implements ${INTERFACES} #end {
}
- AnnotationType 系统默认
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#if (${IMPORT_BLOCK} != "")${IMPORT_BLOCK}
#end
#parse("File Header.java")
#if (${VISIBILITY} == "PUBLIC")public #end @interface ${NAME} #if (${INTERFACES} != "")extends ${INTERFACES} #end {
}
上一篇: 配置vscode 编译运行调试c/c++