icon-cookie
The website uses cookies to optimize your user experience. Using this website grants us the permission to collect certain information essential to the provision of our services to you, but you may change the cookie settings within your browser any time you wish. Learn more
I agree
Summary | 7 Annotations
annotation class Fancy
2017/09/21 07:13
Additional attributes of the annotation can be specified by annotating the annotation class with meta-annotations: @Target specifies the possible kinds of elements which can be annotated with the annotation (classes, functions, properties, expressions etc.); @Retention specifies whether the annotation is stored in the compiled class files and whether it's visible through reflection at runtime (by default, both are true); @Repeatable allows using the same annotation on a single element multiple times; @MustBeDocumented specifies that the annotation is part of the public API and should be included in the class or method signature shown in the generated API documentation.
2017/09/21 07:23
Allowed parameter types are: types that correspond to Java primitive types (Int, Long etc.); strings; classes (Foo::class); enums; other annotations; arrays of the types listed above.
2017/09/21 07:23
If you need to specify a class as an argument of an annotation, use a Kotlin class (KClass). The Kotlin compiler will automatically convert it to a Java class, so that the Java code will be able to see the annotations and arguments normally.
2017/09/21 07:24
Annotations can also be used on lambdas. They will be applied to the invoke() method into which the body of the lambda is generated. This is useful for frameworks like Quasar, which uses annotations for concurrency control.
2017/09/21 07:25
Annotation Use-site Targets
2017/09/21 07:30
Java Annotations
2017/09/21 07:30