Target

Common
JVM
JS
Native
1.0
@Target ( [AnnotationTarget.ANNOTATION_CLASS] ) annotation class Target
(Common source) (Native source)

This meta-annotation indicates the kinds of code elements which are possible targets of an annotation.

If the target meta-annotation is not present on an annotation declaration, the annotation is applicable to the following elements: CLASS , PROPERTY , FIELD , LOCAL_VARIABLE , VALUE_PARAMETER , CONSTRUCTOR , FUNCTION , PROPERTY_GETTER , PROPERTY_SETTER .

Constructors

Common
JVM
JS
Native
1.0

<init>

This meta-annotation indicates the kinds of code elements which are possible targets of an annotation.

<init> ( vararg allowedTargets : AnnotationTarget )

Properties

Common
JVM
JS
Native
1.0

allowedTargets

list of allowed annotation targets

vararg val allowedTargets : Array < out AnnotationTarget >

Extension Properties

JVM
1.0

annotationClass

Returns a KClass instance corresponding to the annotation type of this annotation.

val < T : Annotation > T . annotationClass : KClass < out T >