Package com.squareup.kotlinpoet.metadata

Types

ImmutableKmClass
Link copied to clipboard

Immutable representation of KmClass.

Represents a Kotlin class.

ImmutableKmConstructor
Link copied to clipboard

Immutable representation of KmConstructor.

Represents a constructor of a Kotlin class.

data class ImmutableKmConstructor : ImmutableKmWithFlags
ImmutableKmContract
Link copied to clipboard

Immutable representation of KmContract.

Represents a contract of a Kotlin function.

Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format may change in a subsequent release.

data class ImmutableKmContract
ImmutableKmDeclarationContainer
Link copied to clipboard

Immutable representation of KmDeclarationContainer.

Represents a Kotlin declaration container, such as a class or a package fragment.

interface ImmutableKmDeclarationContainer
ImmutableKmEffect
Link copied to clipboard

Immutable representation of KmEffect.

Represents an effect (a part of the contract of a Kotlin function).

Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format may change in a subsequent release.

data class ImmutableKmEffect
ImmutableKmEffectExpression
Link copied to clipboard

Immutable representation of KmEffectExpression.

Represents an effect expression, the contents of an effect (a part of the contract of a Kotlin function).

Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format may change in a subsequent release.

data class ImmutableKmEffectExpression : ImmutableKmWithFlags
ImmutableKmFlexibleTypeUpperBound
Link copied to clipboard

Immutable representation of KmFlexibleTypeUpperBound.

Represents an upper bound of a flexible Kotlin type.

data class ImmutableKmFlexibleTypeUpperBound
ImmutableKmFunction
Link copied to clipboard

Immutable representation of KmFunction.

Represents a Kotlin function declaration.

data class ImmutableKmFunction : ImmutableKmWithFlags
ImmutableKmLambda
Link copied to clipboard

Immutable representation of KmLambda.

Represents a synthetic class generated for a Kotlin lambda.

data class ImmutableKmLambda
ImmutableKmPackage
Link copied to clipboard

Immutable representation of KmPackage.

Represents a Kotlin package fragment, including single file facades and multi-file class parts.

data class ImmutableKmPackage : ImmutableKmDeclarationContainer
ImmutableKmProperty
Link copied to clipboard

Immutable representation of KmProperty.

Represents a Kotlin property declaration.

data class ImmutableKmProperty : ImmutableKmWithFlags
ImmutableKmType
Link copied to clipboard

Immutable representation of KmType.

Represents a type.

data class ImmutableKmType : ImmutableKmWithFlags
ImmutableKmTypeAlias
Link copied to clipboard

Immutable representation of KmTypeAlias.

Represents a Kotlin type alias declaration.

data class ImmutableKmTypeAlias : ImmutableKmWithFlags
ImmutableKmTypeParameter
Link copied to clipboard

Immutable representation of KmTypeParameter.

Represents a type parameter of a Kotlin class, function, property or type alias.

data class ImmutableKmTypeParameter : ImmutableKmWithFlags
ImmutableKmTypeProjection
Link copied to clipboard

Immutable representation of KmTypeProjection.

Represents type projection used in a type argument of the type based on a class or on a type alias. For example, in MutableMap<in String?, *>, in String? is the type projection which is the first type argument of the type.

data class ImmutableKmTypeProjection
ImmutableKmValueParameter
Link copied to clipboard

Immutable representation of KmValueParameter.

Represents a value parameter of a Kotlin constructor, function or property setter.

data class ImmutableKmValueParameter : ImmutableKmWithFlags
ImmutableKmVersionRequirement
Link copied to clipboard

Immutable representation of KmVersionRequirement.

Represents a version requirement on a Kotlin declaration.

Version requirement is an internal feature of the Kotlin compiler and the standard Kotlin library, enabled for example with the internal kotlin.internal.RequireKotlin annotation.

data class ImmutableKmVersionRequirement : KmVersionRequirementVisitor
ImmutableKmWithFlags
Link copied to clipboard

Represents an immutable kotlinx-metadata type with a common Flags property.

interface ImmutableKmWithFlags
KotlinPoetMetadataPreview
Link copied to clipboard

Indicates that a given API is part of the experimental KotlinPoet metadata support. This exists because kotlinx-metadata is not a stable API, and will remain in place until it is.

annotation class KotlinPoetMetadataPreview
PropertyAccessorFlag
Link copied to clipboard
enum PropertyAccessorFlag : Enum<PropertyAccessorFlag>

Functions

readKotlinClassMetadata
Link copied to clipboard

Returns the KotlinClassMetadata this represents. In general you should only use this function when you don't know what the underlying KotlinClassMetadata subtype is, otherwise you should use one of the more direct functions like toImmutableKmClass.

fun Metadata.readKotlinClassMetadata(): KotlinClassMetadata
toImmutable
Link copied to clipboard
@JvmName(name = "immutableOf")
fun KmClass.toImmutable(): ImmutableKmClass
@JvmName(name = "immutableOf")
fun KmConstructor.toImmutable(): ImmutableKmConstructor
@JvmName(name = "immutableOf")
fun KmContract.toImmutable(): ImmutableKmContract
@JvmName(name = "immutableOf")
fun KmEffect.toImmutable(): ImmutableKmEffect
@JvmName(name = "immutableOf")
fun KmEffectExpression.toImmutable(): ImmutableKmEffectExpression
@JvmName(name = "immutableOf")
fun KmFlexibleTypeUpperBound.toImmutable(): ImmutableKmFlexibleTypeUpperBound
@JvmName(name = "immutableOf")
fun KmFunction.toImmutable(): ImmutableKmFunction
@JvmName(name = "immutableOf")
fun KmLambda.toImmutable(): ImmutableKmLambda
@JvmName(name = "immutableOf")
fun KmPackage.toImmutable(): ImmutableKmPackage
@JvmName(name = "immutableOf")
fun KmProperty.toImmutable(): ImmutableKmProperty
@JvmName(name = "immutableOf")
fun KmType.toImmutable(): ImmutableKmType
@JvmName(name = "immutableOf")
fun KmTypeAlias.toImmutable(): ImmutableKmTypeAlias
@JvmName(name = "immutableOf")
fun KmTypeParameter.toImmutable(): ImmutableKmTypeParameter
@JvmName(name = "immutableOf")
fun KmTypeProjection.toImmutable(): ImmutableKmTypeProjection
@JvmName(name = "immutableOf")
fun KmValueParameter.toImmutable(): ImmutableKmValueParameter
@JvmName(name = "immutableOf")
fun KmVersionRequirement.toImmutable(): ImmutableKmVersionRequirement
toImmutableKmClass
Link copied to clipboard
fun Class<*>.toImmutableKmClass(): ImmutableKmClass
fun TypeElement.toImmutableKmClass(): ImmutableKmClass
fun Metadata.toImmutableKmClass(): ImmutableKmClass
fun KClass<*>.toImmutableKmClass(): ImmutableKmClass

Visits metadata of this class with a new KmClass instance and returns an ImmutableKmClass instance of its values.

fun KotlinClassMetadata.Class.toImmutableKmClass(): ImmutableKmClass
toImmutableKmPackage
Link copied to clipboard

Visits metadata of this class with a new KmPackage instance and returns an ImmutableKmPackage instance of its values.

fun KotlinClassMetadata.FileFacade.toImmutableKmPackage(): ImmutableKmPackage
toKotlinClassMetadata
Link copied to clipboard
inline fun <T : KotlinClassMetadata> Metadata.toKotlinClassMetadata(): T

Properties

declaresDefaultValue
Link copied to clipboard
val KmValueParameter.declaresDefaultValue: Boolean
declaresDefaultValue
Link copied to clipboard
val ImmutableKmValueParameter.declaresDefaultValue: Boolean
getterPropertyAccessorFlags
Link copied to clipboard
hasAnnotations
Link copied to clipboard
val Flags.hasAnnotations: Boolean
hasAnnotations
Link copied to clipboard
val ImmutableKmWithFlags.hasAnnotations: Boolean
hasConstant
Link copied to clipboard
val KmProperty.hasConstant: Boolean
hasConstant
Link copied to clipboard
val ImmutableKmProperty.hasConstant: Boolean
hasGetter
Link copied to clipboard
val KmProperty.hasGetter: Boolean
hasGetter
Link copied to clipboard
val ImmutableKmProperty.hasGetter: Boolean
hasSetter
Link copied to clipboard
val KmProperty.hasSetter: Boolean
hasSetter
Link copied to clipboard
val ImmutableKmProperty.hasSetter: Boolean
isAbstract
Link copied to clipboard
val Flags.isAbstract: Boolean
isAbstract
Link copied to clipboard
val ImmutableKmWithFlags.isAbstract: Boolean
isAnnotation
Link copied to clipboard
val KmClass.isAnnotation: Boolean
isAnnotation
Link copied to clipboard
val ImmutableKmClass.isAnnotation: Boolean
isAnnotationClass
Link copied to clipboard
val Flags.isAnnotationClass: Boolean
isClass
Link copied to clipboard
val Flags.isClass: Boolean
isClass
Link copied to clipboard
val KmClass.isClass: Boolean
isClass
Link copied to clipboard
val ImmutableKmClass.isClass: Boolean
isCompanionObject
Link copied to clipboard
val KmClass.isCompanionObject: Boolean
isCompanionObject
Link copied to clipboard
val ImmutableKmClass.isCompanionObject: Boolean
isCompanionObjectClass
Link copied to clipboard
val Flags.isCompanionObjectClass: Boolean
isConst
Link copied to clipboard
val KmProperty.isConst: Boolean
isConst
Link copied to clipboard
val ImmutableKmProperty.isConst: Boolean
isCrossInline
Link copied to clipboard
val KmValueParameter.isCrossInline: Boolean
isCrossInline
Link copied to clipboard
val ImmutableKmValueParameter.isCrossInline: Boolean
isData
Link copied to clipboard
val KmClass.isData: Boolean
isData
Link copied to clipboard
val ImmutableKmClass.isData: Boolean
isDataClass
Link copied to clipboard
val Flags.isDataClass: Boolean
isDeclaration
Link copied to clipboard
val KmFunction.isDeclaration: Boolean
isDeclaration
Link copied to clipboard
val ImmutableKmFunction.isDeclaration: Boolean
isDeclaration
Link copied to clipboard
val KmProperty.isDeclaration: Boolean
isDeclaration
Link copied to clipboard
val ImmutableKmProperty.isDeclaration: Boolean
isDeclarationFunction
Link copied to clipboard
val Flags.isDeclarationFunction: Boolean
isDelegated
Link copied to clipboard
val KmProperty.isDelegated: Boolean
isDelegated
Link copied to clipboard
val ImmutableKmProperty.isDelegated: Boolean
isDelegation
Link copied to clipboard
val KmFunction.isDelegation: Boolean
isDelegation
Link copied to clipboard
val ImmutableKmFunction.isDelegation: Boolean
isDelegation
Link copied to clipboard
val KmProperty.isDelegation: Boolean
isDelegation
Link copied to clipboard
val ImmutableKmProperty.isDelegation: Boolean
isDelegationFunction
Link copied to clipboard
val Flags.isDelegationFunction: Boolean
isEnum
Link copied to clipboard
val KmClass.isEnum: Boolean
isEnum
Link copied to clipboard
val ImmutableKmClass.isEnum: Boolean
isEnumClass
Link copied to clipboard
val Flags.isEnumClass: Boolean
isEnumEntry
Link copied to clipboard
val KmClass.isEnumEntry: Boolean
isEnumEntry
Link copied to clipboard
val ImmutableKmClass.isEnumEntry: Boolean
isEnumEntryClass
Link copied to clipboard
val Flags.isEnumEntryClass: Boolean
isExpect
Link copied to clipboard
val KmClass.isExpect: Boolean
isExpect
Link copied to clipboard
val ImmutableKmClass.isExpect: Boolean
isExpect
Link copied to clipboard
val KmFunction.isExpect: Boolean
isExpect
Link copied to clipboard
val ImmutableKmFunction.isExpect: Boolean
isExpect
Link copied to clipboard
val KmProperty.isExpect: Boolean
isExpect
Link copied to clipboard
val ImmutableKmProperty.isExpect: Boolean
isExpectClass
Link copied to clipboard
val Flags.isExpectClass: Boolean
isExpectFunction
Link copied to clipboard
val Flags.isExpectFunction: Boolean
isExternal
Link copied to clipboard
val KmClass.isExternal: Boolean
isExternal
Link copied to clipboard
val ImmutableKmClass.isExternal: Boolean
isExternal
Link copied to clipboard
val KmFunction.isExternal: Boolean
isExternal
Link copied to clipboard
val ImmutableKmFunction.isExternal: Boolean
isExternal
Link copied to clipboard
val KmProperty.isExternal: Boolean
isExternal
Link copied to clipboard
val ImmutableKmProperty.isExternal: Boolean
isExternalClass
Link copied to clipboard
val Flags.isExternalClass: Boolean
isExternalFunction
Link copied to clipboard
val Flags.isExternalFunction: Boolean
isFakeOverride
Link copied to clipboard
val KmFunction.isFakeOverride: Boolean
isFakeOverride
Link copied to clipboard
val ImmutableKmFunction.isFakeOverride: Boolean
isFakeOverride
Link copied to clipboard
val KmProperty.isFakeOverride: Boolean
isFakeOverride
Link copied to clipboard
val ImmutableKmProperty.isFakeOverride: Boolean
isFakeOverrideFunction
Link copied to clipboard
val Flags.isFakeOverrideFunction: Boolean
isFakeOverrideProperty
Link copied to clipboard
val Flags.isFakeOverrideProperty: Boolean
isFinal
Link copied to clipboard
val Flags.isFinal: Boolean
isFinal
Link copied to clipboard
val ImmutableKmWithFlags.isFinal: Boolean
isInfix
Link copied to clipboard
val KmFunction.isInfix: Boolean
isInfix
Link copied to clipboard
val ImmutableKmFunction.isInfix: Boolean
isInfixFunction
Link copied to clipboard
val Flags.isInfixFunction: Boolean
isInline
Link copied to clipboard
val KmClass.isInline: Boolean
isInline
Link copied to clipboard
val ImmutableKmClass.isInline: Boolean
isInline
Link copied to clipboard
val KmFunction.isInline: Boolean
isInline
Link copied to clipboard
val ImmutableKmFunction.isInline: Boolean
isInlineClass
Link copied to clipboard
val Flags.isInlineClass: Boolean
isInlineFunction
Link copied to clipboard
val Flags.isInlineFunction: Boolean
isInner
Link copied to clipboard
val KmClass.isInner: Boolean
isInner
Link copied to clipboard
val ImmutableKmClass.isInner: Boolean
isInnerClass
Link copied to clipboard
val Flags.isInnerClass: Boolean
isInterface
Link copied to clipboard
val Flags.isInterface: Boolean
isInterface
Link copied to clipboard
val KmClass.isInterface: Boolean
isInterface
Link copied to clipboard
val ImmutableKmClass.isInterface: Boolean
isInternal
Link copied to clipboard
val Flags.isInternal: Boolean
isInternal
Link copied to clipboard
val ImmutableKmWithFlags.isInternal: Boolean
isLateinit
Link copied to clipboard
val KmProperty.isLateinit: Boolean
isLateinit
Link copied to clipboard
val ImmutableKmProperty.isLateinit: Boolean
isLocal
Link copied to clipboard
val Flags.isLocal: Boolean
isLocal
Link copied to clipboard
val ImmutableKmWithFlags.isLocal: Boolean
isNoInline
Link copied to clipboard
val KmValueParameter.isNoInline: Boolean
isNoInline
Link copied to clipboard
val ImmutableKmValueParameter.isNoInline: Boolean
isNullable
Link copied to clipboard
val KmType.isNullable: Boolean
isNullable
Link copied to clipboard
val ImmutableKmType.isNullable: Boolean
isNullableType
Link copied to clipboard
val Flags.isNullableType: Boolean
isObject
Link copied to clipboard
val KmClass.isObject: Boolean
isObject
Link copied to clipboard
val ImmutableKmClass.isObject: Boolean
isObjectClass
Link copied to clipboard
val Flags.isObjectClass: Boolean
isOpen
Link copied to clipboard
val Flags.isOpen: Boolean
isOpen
Link copied to clipboard
val ImmutableKmWithFlags.isOpen: Boolean
isOperator
Link copied to clipboard
val KmFunction.isOperator: Boolean
isOperator
Link copied to clipboard
val ImmutableKmFunction.isOperator: Boolean
isOperatorFunction
Link copied to clipboard
val Flags.isOperatorFunction: Boolean
isPrimary
Link copied to clipboard
val KmConstructor.isPrimary: Boolean
isPrimary
Link copied to clipboard
val ImmutableKmConstructor.isPrimary: Boolean
isPrimaryConstructor
Link copied to clipboard
val Flags.isPrimaryConstructor: Boolean
isPrivate
Link copied to clipboard
val Flags.isPrivate: Boolean
isPrivate
Link copied to clipboard
val ImmutableKmWithFlags.isPrivate: Boolean
isPrivate_to_this
Link copied to clipboard
val Flags.isPrivate_to_this: Boolean
isPrivate_to_this
Link copied to clipboard
val ImmutableKmWithFlags.isPrivate_to_this: Boolean
isPropertyAccessorExternal
Link copied to clipboard
val Flags.isPropertyAccessorExternal: Boolean
isPropertyAccessorInline
Link copied to clipboard
val Flags.isPropertyAccessorInline: Boolean
isPropertyAccessorNotDefault
Link copied to clipboard
val Flags.isPropertyAccessorNotDefault: Boolean
isProtected
Link copied to clipboard
val Flags.isProtected: Boolean
isProtected
Link copied to clipboard
val ImmutableKmWithFlags.isProtected: Boolean
isPublic
Link copied to clipboard
val Flags.isPublic: Boolean
isPublic
Link copied to clipboard
val ImmutableKmWithFlags.isPublic: Boolean
isReified
Link copied to clipboard
val KmTypeParameter.isReified: Boolean
isReified
Link copied to clipboard
val ImmutableKmTypeParameter.isReified: Boolean
isSealed
Link copied to clipboard
val Flags.isSealed: Boolean
isSealed
Link copied to clipboard
val ImmutableKmWithFlags.isSealed: Boolean
isSecondary
Link copied to clipboard
val KmConstructor.isSecondary: Boolean
isSecondary
Link copied to clipboard
val ImmutableKmConstructor.isSecondary: Boolean
isSuspend
Link copied to clipboard
val KmType.isSuspend: Boolean
isSuspend
Link copied to clipboard
val ImmutableKmType.isSuspend: Boolean
isSuspend
Link copied to clipboard
val KmFunction.isSuspend: Boolean
isSuspend
Link copied to clipboard
val ImmutableKmFunction.isSuspend: Boolean
isSuspendFunction
Link copied to clipboard
val Flags.isSuspendFunction: Boolean
isSuspendType
Link copied to clipboard
val Flags.isSuspendType: Boolean
isSynthesized
Link copied to clipboard
val KmFunction.isSynthesized: Boolean
isSynthesized
Link copied to clipboard
val ImmutableKmFunction.isSynthesized: Boolean
isSynthesized
Link copied to clipboard
val KmProperty.isSynthesized: Boolean
isSynthesized
Link copied to clipboard
val ImmutableKmProperty.isSynthesized: Boolean
isSynthesizedFunction
Link copied to clipboard
val Flags.isSynthesizedFunction: Boolean
isTailRec
Link copied to clipboard
val KmFunction.isTailRec: Boolean
isTailRec
Link copied to clipboard
val ImmutableKmFunction.isTailRec: Boolean
isTailRecFunction
Link copied to clipboard
val Flags.isTailRecFunction: Boolean
isVal
Link copied to clipboard
val KmProperty.isVal: Boolean
isVal
Link copied to clipboard
val ImmutableKmProperty.isVal: Boolean
isVar
Link copied to clipboard
val KmProperty.isVar: Boolean
isVar
Link copied to clipboard
val ImmutableKmProperty.isVar: Boolean
propertyAccessorFlags
Link copied to clipboard
val Flags.propertyAccessorFlags: Set<PropertyAccessorFlag>
setterPropertyAccessorFlags
Link copied to clipboard