欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Import block visibility abstract 自定义配置(AndroidStudio4.0)

程序员文章站 2024-02-29 12:13:46
...

版权声明:本文为延成原创文章,转载请标明出处

简单解释

Import block visibility abstract 自定义配置(AndroidStudio4.0)
  • IMPORT BLOCK 导包
  • VISIBILITY 值为PUBLIC或 PACKAGE_PRIVATE 或不填 分别对应public修饰符 - private 修饰符和没有修饰符
  • FINAL 类是否加final修饰
  • SUPERCLASS 指定父类
  • INTERFACES 指定接口

配置自己的模板

Import block visibility abstract 自定义配置(AndroidStudio4.0)
  • Class 模板自定义
Import block visibility abstract 自定义配置(AndroidStudio4.0)
#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 模板自定义
Import block visibility abstract 自定义配置(AndroidStudio4.0)
#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 模板自定义
Import block visibility abstract 自定义配置(AndroidStudio4.0)
#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 模板自定义
Import block visibility abstract 自定义配置(AndroidStudio4.0)
#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 {
}

相关标签: android工具