New built-in annotations: Retention, Repeatable, MustBeDocumented

This commit is contained in:
Mikhail Glukhikh
2015-09-02 17:41:03 +03:00
parent 4e3bd10cd3
commit 7dff4ad916
2 changed files with 38 additions and 0 deletions
@@ -89,3 +89,23 @@ public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = tru
val repeatable: Boolean = false,
val mustBeDocumented: Boolean = false
)
/**
* This meta-annotation determines whether an annotation is stored in binary output and visible for reflection. By default, both are true.
*
* @property value necessary annotation retention (RUNTIME, BINARY or SOURCE)
*/
target(AnnotationTarget.ANNOTATION_CLASS)
public annotation class Retention(val value: AnnotationRetention = AnnotationRetention.RUNTIME)
/**
* This meta-annotation determines that an annotation is applicable twice or more on a single code element
*/
target(AnnotationTarget.ANNOTATION_CLASS)
public annotation class Repeatable
/**
* This meta-annotation determines that an annotation is a part of public API and therefore must be documented
*/
target(AnnotationTarget.ANNOTATION_CLASS)
public annotation class MustBeDocumented