W3cubDocs

/Kotlin

Target

Platform and version requirements: JVM (1.0), JS (1.1), Native (1.3)
@Target([AnnotationTarget.ANNOTATION_CLASS]) annotation class Target

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

Platform and version requirements: JVM (1.0), JS (1.0), 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

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

allowedTargets

list of allowed annotation targets

vararg val allowedTargets: Array<out AnnotationTarget>

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