W3cubDocs

/Kotlin

KAnnotatedElement

Platform and version requirements: JVM (1.0), JS (1.1), Native (1.3)
interface KAnnotatedElement

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

Properties

Platform and version requirements: JVM (1.0), JS (1.0)

annotations

Annotations which are present on this element.

abstract val annotations: List<Annotation>

Extension Functions

Platform and version requirements: JVM (1.1)

findAnnotation

Returns an annotation of the given type on this element.

fun <T : Annotation> KAnnotatedElement.findAnnotation(): T?
Platform and version requirements: JVM (1.3)

hasAnnotation

Returns true if this element is annotated with an annotation of type T.

fun <T : Annotation> KAnnotatedElement.hasAnnotation(): Boolean

Inheritors

KCallable

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

Platform and version requirements:
interface KCallable<out R>
Platform and version requirements: JVM (1.0), JS (1.1), Native (1.3)
interface KCallable<out R> : KAnnotatedElement

KClass

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.

Platform and version requirements:
interface KClass<T : Any>
Platform and version requirements: JVM (1.0), JS (1.1), Native (1.3)
interface KClass<T : Any> : 
    KDeclarationContainer, 
    KAnnotatedElement, 
    KClassifier
Platform and version requirements: JVM (1.0), JS (1.0)

KParameter

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

interface KParameter : KAnnotatedElement

KType

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

Platform and version requirements: JVM (1.0), JS (1.1)
interface KType : KAnnotatedElement
Platform and version requirements: Native (1.3)
interface KType

© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-annotated-element/index.html