KAnnotatedElement
Represents an annotated element and allows to obtain its annotations. See the Kotlin language documentation for more information.
Properties
annotations
Annotations which are present on this element.
abstract val annotations: List<Annotation>
Extension Functions
findAnnotation
Returns an annotation of the given type on this element.
fun <T : Annotation> KAnnotatedElement.findAnnotation(): T?
findAnnotations
Returns all annotations of the given type on this element, including individually applied annotations as well as repeated annotations.
fun <T : Annotation> KAnnotatedElement.findAnnotations(): List<T>
fun <T : Annotation> KAnnotatedElement.findAnnotations(
klass: KClass<T>
): List<T>
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.
interface KCallable<out R>
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.
interface KClass<T : Any> : KClassifier
interface KClass<T : Any> :
KDeclarationContainer,
KAnnotatedElement,
KClassifier
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.
interface KType
interface KType : KAnnotatedElement