ClassInspector

A basic interface for looking up JVM information about a given Class.

interface ClassInspector

Functions

containerData
Link copied to clipboard

Creates a new ContainerData instance for a given declarationContainer.

abstract fun containerData(declarationContainer: ImmutableKmDeclarationContainer, className: ClassName, parentClassName: ClassName?): ContainerData
declarationContainerFor
Link copied to clipboard

Looks up other declaration containers, such as for nested members. Note that this class would always be Kotlin, so Metadata can be relied on for this.

abstract fun declarationContainerFor(className: ClassName): ImmutableKmDeclarationContainer
enumEntry
Link copied to clipboard

Looks up the enum entry on a given enum given its member name.

abstract fun enumEntry(enumClassName: ClassName, memberName: String): EnumEntryData
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
isInterface
Link copied to clipboard

Looks up a class and returns whether or not it is an interface. Note that this class can be Java or Kotlin, so Metadata should not be relied on for this.

abstract fun isInterface(className: ClassName): Boolean
methodExists
Link copied to clipboard

Looks up if a given methodSignature within className exists.

abstract fun methodExists(className: ClassName, methodSignature: JvmMethodSignature): Boolean
toString
Link copied to clipboard
open override fun toString(): String

Properties

supportsNonRuntimeRetainedAnnotations
Link copied to clipboard

Indicates if this ClassInspector supports AnnotationRetention.RUNTIME-retained annotations. This is used to indicate if manual inference of certain non-RUNTIME-retained annotations should be done, such as JvmName.

abstract val supportsNonRuntimeRetainedAnnotations: Boolean

Extensions

classFor
Link copied to clipboard

Looks up other classes, such as for nested members. Note that this class would always be Kotlin, so Metadata can be relied on for this.

fun ClassInspector.classFor(className: ClassName): ImmutableKmClass
containerData
Link copied to clipboard

Creates a new ContainerData instance for a given className.

fun ClassInspector.containerData(className: ClassName, parentClassName: ClassName?): ContainerData