Package-level declarations

Runtime API for /docs/reference/reflection.html

Runtime API for /docs/reference/reflection.html

Runtime API for /docs/reference/reflection.html

Runtime API for /docs/reference/reflection.html

Types

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.ANNOTATION_CLASS])
annotation class AssociatedObjectKey

Makes the annotated annotation class an associated object key.

@Target(allowedTargets = [AnnotationTarget.ANNOTATION_CLASS])
annotation class AssociatedObjectKey

Makes the annotated annotation class an associated object key.

Link copied to clipboard

The experimental marker for associated objects API.

The experimental marker for associated objects API.

Link copied to clipboard

Represents an annotated element and allows to obtain its annotations. See the Kotlin language documentation for more information.

Represents an annotated element and allows to obtain its annotations. See the Kotlin language documentation for more information.

Link copied to clipboard
expect interface KCallable<out R>

Represents a callable entity, such as a function or a property.

actual interface KCallable<out R> : KAnnotatedElement

Represents a callable entity, such as a function or a property.

actual interface KCallable<out R>

Represents a callable entity, such as a function or a property.

actual interface KCallable<out R> : KAnnotatedElement

Represents a callable entity, such as a function or a property.

Link copied to clipboard
expect interface KClass<T : Any> : KClassifier

Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class syntax. See the Kotlin language documentation for more information.

Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class syntax. See the Kotlin language documentation for more information.

actual interface KClass<T : Any> : KClassifier

Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class syntax. See the Kotlin language documentation for more information.

actual interface KClass<T : Any> : KDeclarationContainer, KAnnotatedElement, KClassifier

Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class syntax. See the Kotlin language documentation for more information.

Link copied to clipboard
interface KClassifier

A classifier is either a class or a type parameter.

Since Kotlin 1.1
Link copied to clipboard

Represents an entity which may contain declarations of any other entities, such as a class or a package.

Represents an entity which may contain declarations of any other entities, such as a class or a package.

Link copied to clipboard
expect interface KFunction<out R> : KCallable<R> , Function<R>

Represents a function with introspection capabilities.

actual interface KFunction<out R> : KCallable<R> , Function<R>

Represents a function with introspection capabilities.

actual interface KFunction<out R> : KCallable<R> , Function<R>

Represents a function with introspection capabilities.

actual interface KFunction<out R> : KCallable<R> , Function<R>
Link copied to clipboard
expect interface KMutableProperty<V> : KProperty<V>

Represents a property declared as a var.

actual interface KMutableProperty<V> : KProperty<V>

Represents a property declared as a var.

actual interface KMutableProperty<V> : KProperty<V>

Represents a property declared as a var.

actual interface KMutableProperty<V> : KProperty<V>

Represents a property declared as a var.

Link copied to clipboard

Represents a var-property without any kind of receiver.

Represents a var-property without any kind of receiver.

Represents a var-property without any kind of receiver.

Link copied to clipboard
expect interface KMutableProperty1<T, V> : KProperty1<T, V> , KMutableProperty<V>

Represents a var-property, operations on which take one receiver as a parameter.

actual interface KMutableProperty1<T, V> : KProperty1<T, V> , KMutableProperty<V>

Represents a var-property, operations on which take one receiver as a parameter.

actual interface KMutableProperty1<T, V> : KProperty1<T, V> , KMutableProperty<V>

Represents a var-property, operations on which take one receiver as a parameter.

actual interface KMutableProperty1<T, V> : KProperty1<T, V> , KMutableProperty<V>
Link copied to clipboard
expect interface KMutableProperty2<D, E, V> : KProperty2<D, E, V> , KMutableProperty<V>

Represents a var-property, operations on which take two receivers as parameters.

actual interface KMutableProperty2<D, E, V> : KProperty2<D, E, V> , KMutableProperty<V>

Represents a var-property, operations on which take two receivers as parameters.

actual interface KMutableProperty2<D, E, V> : KProperty2<D, E, V> , KMutableProperty<V>

Represents a var-property, operations on which take two receivers as parameters.

actual interface KMutableProperty2<D, E, V> : KProperty2<D, E, V> , KMutableProperty<V>
Link copied to clipboard

Represents a parameter passed to a function or a property getter/setter, including this and extension receiver parameters.

Link copied to clipboard
expect interface KProperty<out V> : KCallable<V>

Represents a property, such as a named val or var declaration. Instances of this class are obtainable by the :: operator.

actual interface KProperty<out V> : KCallable<V>

Represents a property, such as a named val or var declaration. Instances of this class are obtainable by the :: operator.

actual interface KProperty<out V> : KCallable<V>

Represents a property, such as a named val or var declaration. Instances of this class are obtainable by the :: operator.

actual interface KProperty<out V> : KCallable<V>

Represents a property, such as a named val or var declaration. Instances of this class are obtainable by the :: operator.

Link copied to clipboard
expect interface KProperty0<out V> : KProperty<V> , Function0<V>

Represents a property without any kind of receiver. Such property is either originally declared in a receiverless context such as a package, or has the receiver bound to it.

actual interface KProperty0<out V> : KProperty<V> , Function0<V>

Represents a property without any kind of receiver. Such property is either originally declared in a receiverless context such as a package, or has the receiver bound to it.

actual interface KProperty0<out V> : KProperty<V> , Function0<V>

Represents a property without any kind of receiver. Such property is either originally declared in a receiverless context such as a package, or has the receiver bound to it.

actual interface KProperty0<out V> : KProperty<V> , Function0<V>
Link copied to clipboard
expect interface KProperty1<T, out V> : KProperty<V> , Function1<T, V>

Represents a property, operations on which take one receiver as a parameter.

actual interface KProperty1<T, out V> : KProperty<V> , Function1<T, V>

Represents a property, operations on which take one receiver as a parameter.

actual interface KProperty1<T, out V> : KProperty<V> , Function1<T, V>

Represents a property, operations on which take one receiver as a parameter.

actual interface KProperty1<T, out V> : KProperty<V> , Function1<T, V>
Link copied to clipboard
expect interface KProperty2<D, E, out V> : KProperty<V> , Function2<D, E, V>

Represents a property, operations on which take two receivers as parameters, such as an extension property declared in a class.

actual interface KProperty2<D, E, out V> : KProperty<V> , Function2<D, E, V>

Represents a property, operations on which take two receivers as parameters, such as an extension property declared in a class.

actual interface KProperty2<D, E, out V> : KProperty<V> , Function2<D, E, V>

Represents a property, operations on which take two receivers as parameters, such as an extension property declared in a class.

actual interface KProperty2<D, E, out V> : KProperty<V> , Function2<D, E, V>
Link copied to clipboard
expect interface KType

Represents a type. Type is usually either a class with optional type arguments, or a type parameter of some declaration, plus nullability.

actual interface KType : KAnnotatedElement

Represents a type. Type is usually either a class with optional type arguments, or a type parameter of some declaration, plus nullability.

actual interface KType

Represents a type. Type is usually either a class with optional type arguments, or a type parameter of some declaration, plus nullability.

actual interface KType

Represents a type. Type is usually either a class with optional type arguments, or a type parameter of some declaration, plus nullability.

Link copied to clipboard

Represents a declaration of a type parameter of a class or a callable. See the Kotlin language documentation for more information.

Since Kotlin 1.1
Link copied to clipboard
data class KTypeProjection(val variance: KVariance?, val type: KType?)

Represents a type projection. Type projection is usually the argument to another type in a type usage. For example, in the type Array<out Number>, out Number is the covariant projection of the type represented by the class Number.

Since Kotlin 1.1
Link copied to clipboard

Represents variance applied to a type parameter on the declaration site (declaration-site variance), or to a type in a projection (use-site variance).

Since Kotlin 1.1
Link copied to clipboard

Visibility is an aspect of a Kotlin declaration regulating where that declaration is accessible in the source code. Visibility can be changed with one of the following modifiers: public, protected, internal, private.

Since Kotlin 1.1

Functions

Link copied to clipboard
fun <T : Any> KClass<T>.cast(value: Any?): T

Casts the given value to the class represented by this KClass object. Throws an exception if the value is null or if it is not an instance of this class.

Since Kotlin 1.4
Link copied to clipboard

If T is an @AssociatedObjectKey-annotated annotation class and this class is annotated with @T (S::class), returns object S.

If T is an @AssociatedObjectKey-annotated annotation class and this class is annotated with @T (S::class), returns object S.

Link copied to clipboard
fun <T : Any> KClass<T>.safeCast(value: Any?): T?

Casts the given value to the class represented by this KClass object. Returns null if the value is null or if it is not an instance of this class.

Since Kotlin 1.4
Link copied to clipboard

Returns a runtime representation of the given reified type T as an instance of KType.

Since Kotlin 1.3

Properties

Link copied to clipboard
@ExperimentalStdlibApi
val KType.javaType: Type

Returns a Java Type instance corresponding to the given Kotlin type.