KmClass

class KmClass : KmClassVisitor, KmDeclarationContainer

Represents a Kotlin class.

'Class' here is used in a broad sense and includes interfaces, enum classes, companion objects, et cetera. Precise kind of the class can be obtained via KmClass.kind. Various class attributes can be read and manipulated via extension properties, such as KmClass.visibility or KmClass.isData.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

JVM internal name of the original class this anonymous object is copied from. This value is set for anonymous objects copied from bodies of inline functions to the use site by the Kotlin compiler.

Link copied to clipboard

Name of the companion object of this class, if it has one.

Link copied to clipboard

Constructors of the class.

Link copied to clipboard

Types of context receivers of the class.

Link copied to clipboard

Names of enum entries, if this class is an enum class.

Link copied to clipboard
open override val functions: MutableList<KmFunction>

Functions in the class.

Link copied to clipboard

Indicates that the corresponding class has at least one annotation.

Link copied to clipboard

Indicates that the corresponding enum class has synthetic ".entries" property in bytecode.

Link copied to clipboard

Applicable to an interface compiled with -Xjvm-default=all or all-compatibility. True if interface has method bodies in it, false if Kotlin compiler moved all interface method bodies into a nested DefaultImpls class.

Link copied to clipboard

Name of the underlying property, if this class is inline.

Link copied to clipboard

Type of the underlying property, if this class is inline.

Link copied to clipboard

Indicates if an interface was compiled with -Xjvm-default=all-compatibility.

Link copied to clipboard

Indicates that the corresponding class or object is data. Always false for other kinds.

Link copied to clipboard

Indicates that the corresponding class is expect.

Link copied to clipboard

Indicates that the corresponding class is external.

Link copied to clipboard

Indicates that the corresponding class is a functional interface, i.e., marked with the keyword fun.

Link copied to clipboard

Indicates that the corresponding class is inner.

Link copied to clipboard

Indicates that the corresponding class is either a pre-Kotlin-1.5 inline class, or a 1.5+ value class.

Link copied to clipboard

Represents kind of the corresponding class — whether it is a regular class or an interface, companion object, et cetera.

Link copied to clipboard

Metadata of local delegated properties used somewhere inside this class (but not in a nested class). Note that for classes produced by the Kotlin compiler, such properties will have default accessors.

Link copied to clipboard

Represents modality of the corresponding class.

Link copied to clipboard

Name of the module where this class is declared.

Link copied to clipboard
lateinit var name: ClassName

Name of the class.

Link copied to clipboard

Names of nested classes of this class.

Link copied to clipboard
open override val properties: MutableList<KmProperty>

Properties in the class.

Link copied to clipboard

Names of direct subclasses of this class, if this class is sealed.

Link copied to clipboard

Supertypes of the class.

Link copied to clipboard
open override val typeAliases: MutableList<KmTypeAlias>

Type aliases in the class.

Link copied to clipboard

Type parameters of the class.

Link copied to clipboard

Version requirements on this class.

Link copied to clipboard

Represents visibility of the corresponding class.

Functions

Link copied to clipboard
open fun visitEnd()

Visits the end of the class.