Skip to content

KotlinCompositePackageProvider

A composite KotlinPackageProvider which combines all packages provided by its child providers. It should be created with KotlinCompositePackageProvider.create.

Types

Companion

object Companion

Properties

providers

open override val providers: List<KotlinPackageProvider>

Functions

doesKotlinOnlyPackageExist

open override fun doesKotlinOnlyPackageExist(packageFqName: FqName): Boolean

Checks if a package named packageFqName exists. The package should contain Kotlin declarations.

Note that for Kotlin, a package doesn't need to correspond to a directory structure like in Java. So, a file's package FqName is determined by the package directive.

doesPackageExist

open override fun doesPackageExist(packageFqName: FqName, platform: TargetPlatform): Boolean

Checks if a package named packageFqName exists in the context of the given platform. This includes Kotlin packages as well as platform-specific packages.

Generally, the result is equal to: doesKotlinOnlyPackageExist || doesPlatformSpecificPackageExist.

doesPlatformSpecificPackageExist

open override fun doesPlatformSpecificPackageExist(packageFqName: FqName, platform: TargetPlatform): Boolean

Checks if a package named packageFqName exists. The package should contain platform-specific declarations.

getKotlinOnlySubpackageNames

open override fun getKotlinOnlySubpackageNames(packageFqName: FqName): Set<Name>

Returns the list of subpackages of a given package which contain Kotlin declarations.

getPlatformSpecificSubpackageNames

open override fun getPlatformSpecificSubpackageNames(packageFqName: FqName, platform: TargetPlatform): Set<Name>

Returns the list of subpackages of a given package which contain platform-specific declarations.

getSubpackageNames

open override fun getSubpackageNames(packageFqName: FqName, platform: TargetPlatform): Set<Name>

Returns the list of subpackages of a given package.

The returned subpackage list contains both Kotlin and platform-specific subpackages (e.g., for Kotlin/JVM, it should include Java packages).

Generally, the result is equal to: getKotlinOnlySubpackageNames union getPlatformSpecificSubpackageNames.