package java.lang.annotation;
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Target {
ElementType value();
}
Documented
Retention(value = RetentionPolicy.RUNTIME)// Error : Target(value = ElementType.FIELD, ElementType.CONSTRUCTOR)
// Error : Target(value = array(ElementType.FIELD, ElementType.CONSTRUCTOR))
// Error : Target(value = array<ElementType>(ElementType.FIELD, ElementType.CONSTRUCTOR))
// Error : Target(value = Array<ElementType>(ElementType.FIELD, ElementType.CONSTRUCTOR)) annotation class TestAnnotation(val a: String, val b: Int)
But, i don’t know write typed array ElementType[] value();
How to write typed array?