Stay organized with collections
Save and categorize content based on your preferences.
ClassContext
interface ClassContext
Summary
Public properties |
ClassData |
Contains information about the class that will be instrumented.
|
Public functions
loadClassData
fun loadClassData(className: String): ClassData?
Loads the class data for the class with given className
.
Returns null if a class named className
couldn't be found in the runtime classpath of the class defined by the currentClassData
.
Parameters |
className: String |
the fully qualified name of the class, (e.g. "com.android.build.api.instrumentation.ClassContext")
|
Public properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ClassContext\n============\n\n\n```\ninterface ClassContext\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSummary\n-------\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ClassData](/reference/tools/gradle-api/7.3/com/android/build/api/instrumentation/ClassData)`?` | [loadClassData](/reference/tools/gradle-api/7.3/com/android/build/api/instrumentation/ClassContext#loadClassData(kotlin.String))`(className: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Loads the class data for the class with given [className](/reference/tools/gradle-api/7.3/com/android/build/api/instrumentation/ClassContext#loadClassData(kotlin.String)). |\n\n| ### Public properties ||\n|----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ClassData](/reference/tools/gradle-api/7.3/com/android/build/api/instrumentation/ClassData) | [currentClassData](/reference/tools/gradle-api/7.3/com/android/build/api/instrumentation/ClassContext#currentClassData()) Contains information about the class that will be instrumented. |\n\nPublic functions\n----------------\n\n### loadClassData\n\n```\nfun loadClassData(className: String): ClassData?\n```\n\nLoads the class data for the class with given [className](/reference/tools/gradle-api/7.3/com/android/build/api/instrumentation/ClassContext#loadClassData(kotlin.String)).\n\nReturns null if a class named [className](/reference/tools/gradle-api/7.3/com/android/build/api/instrumentation/ClassContext#loadClassData(kotlin.String)) couldn't be found in the runtime classpath of the class defined by the [currentClassData](/reference/tools/gradle-api/7.3/com/android/build/api/instrumentation/ClassContext#currentClassData()). \n\n| Parameters ||\n|-----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|\n| `className: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the fully qualified name of the class, (e.g. \"com.android.build.api.instrumentation.ClassContext\") |\n\nPublic properties\n-----------------\n\n### currentClassData\n\n```\nval currentClassData: ClassData\n```\n\nContains information about the class that will be instrumented."]]