MultiFileClassFacade

class MultiFileClassFacade(var partClassNames: List<String>, var version: JvmMetadataVersion, var flags: Int) : KotlinClassMetadata

Represents metadata of a class file containing a compiled multi-file class facade.

Multi-file class facade is a facade file produced from several Kotlin source files marked with JvmMultifileClass and same JvmName. It does not have any declarations; it only contains partClassNames to indicate where individual parts are located.

Consider the following example. Suppose we have two files, partOne.kt and partTwo.kt:

// partOne.kt
@file:JvmMultifileClass
@file:JvmName("MultiFileClass")

fun partOne(): String = "one"

// partTwo.kt
@file:JvmMultifileClass
@file:JvmName("MultiFileClass")

fun partTwo(): String = "two"

In this case, there would be three classfiles produced by the compiler, each with its own metadata. Metadata for MultiFileClass.class would be of type MultiFileClassFacade and contain partClassNames that would indicate class file names for the parts: [MultiFileClass__PartOneKt, MultiFileClass__PartTwoKt]. Using these names, you can load metadata from those classes with type MultiFileClassPart.

See also

Constructors

Link copied to clipboard
constructor(partClassNames: List<String>, version: JvmMetadataVersion, flags: Int)

Properties

Link copied to clipboard
open override var flags: Int

Additional classfile-level flags of this metadata. See Metadata.extraInt for possible values.

Link copied to clipboard

JVM internal names of the part classes which this multi-file class combines.

Link copied to clipboard
open override var version: JvmMetadataVersion

Version of this metadata.

Functions

Link copied to clipboard
open override fun write(): Metadata

Encodes and writes this metadata to the new instance of Metadata.