Package kotlin.reflect
Runtime API for Kotlin reflection
Types
KAnnotatedElement
Represents an annotated element and allows to obtain its annotations. See the Kotlin language documentation for more information.
interface KAnnotatedElementKCallable
Represents a callable entity, such as a function or a property.
interface KCallable<out R>interface KCallable<out R> : KAnnotatedElementKClass
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.
interface KClass<T : Any>interface KClass<T : Any> :
KDeclarationContainer,
KAnnotatedElement,
KClassifierKClassifier
A classifier is either a class or a type parameter.
interface KClassifierKDeclarationContainer
Represents an entity which may contain declarations of any other entities, such as a class or a package.
interface KDeclarationContainerKMutableProperty
Represents a property declared as a var.
interface KMutableProperty<R> : KProperty<R>KMutableProperty0
Represents a var-property without any kind of receiver.
interface KMutableProperty0<R> :
KProperty0<R>,
KMutableProperty<R>KMutableProperty1
Represents a var-property, operations on which take one receiver as a parameter.
interface KMutableProperty1<T, R> :
KProperty1<T, R>,
KMutableProperty<R>KMutableProperty2
Represents a var-property, operations on which take two receivers as parameters.
interface KMutableProperty2<D, E, R> :
KProperty2<D, E, R>,
KMutableProperty<R>interface KMutableProperty2<T1, T2, R> :
KProperty2<T1, T2, R>,
KMutableProperty<R>KParameter
Represents a parameter passed to a function or a property getter/setter,
including this and extension receiver parameters.
interface KParameter : KAnnotatedElementKProperty
Represents a property, such as a named val or var declaration.
Instances of this class are obtainable by the :: operator.
interface KProperty<out R> : KCallable<R>KProperty0
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.
interface KProperty0<out R> : KProperty<R>, () -> RKProperty1
Represents a property, operations on which take one receiver as a parameter.
interface KProperty1<T, out R> : KProperty<R>, (T) -> RKType
Represents a type. Type is usually either a class with optional type arguments, or a type parameter of some declaration, plus nullability.
interface KType : KAnnotatedElementinterface KTypeKTypeParameter
Represents a declaration of a type parameter of a class or a callable. See the Kotlin language documentation for more information.
interface KTypeParameter : KClassifierKTypeProjection
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.
data class KTypeProjectionKVariance
Represents variance applied to a type parameter on the declaration site (declaration-site variance), or to a type in a projection (use-site variance).
enum class KVarianceKVisibility
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.
enum class KVisibilityAnnotations
AssociatedObjectKey
Makes the annotated annotation class an associated object key.
annotation class AssociatedObjectKeyExperimentalAssociatedObjects
The experimental marker for associated objects API.
annotation class ExperimentalAssociatedObjectsFunctions
findAssociatedObject
If T is an @AssociatedObjectKey-annotated annotation class and this class is annotated with @T (S::class),
returns object S.
fun <T : Annotation> KClass<*>.findAssociatedObject(): Any?