Annotation mapper is introduced to map java annotation targets to kotlin targets + a set of new / fixed tests
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package test;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
public class AnnotationTargets {
|
||||
|
||||
public @interface base {
|
||||
|
||||
}
|
||||
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
public @interface annotation {
|
||||
|
||||
}
|
||||
|
||||
@Target(ElementType.CONSTRUCTOR)
|
||||
public @interface constructor {
|
||||
|
||||
}
|
||||
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface field {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Target(ElementType.LOCAL_VARIABLE)
|
||||
public @interface local {
|
||||
|
||||
}
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface method {
|
||||
|
||||
}
|
||||
|
||||
@Target(ElementType.PACKAGE)
|
||||
public @interface packag {
|
||||
|
||||
}
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
public @interface parameter {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface type {
|
||||
|
||||
}
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
|
||||
public @interface multiple {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package test
|
||||
|
||||
public open class AnnotationTargets {
|
||||
public constructor AnnotationTargets()
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.ANNOTATION_CLASS}) public final class annotation : kotlin.Annotation {
|
||||
public constructor annotation()
|
||||
}
|
||||
|
||||
public final class base : kotlin.Annotation {
|
||||
public constructor base()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.CONSTRUCTOR}) public final class constructor : kotlin.Annotation {
|
||||
public constructor constructor()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FIELD}) public final class field : kotlin.Annotation {
|
||||
public constructor field()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.LOCAL_VARIABLE}) public final class local : kotlin.Annotation {
|
||||
public constructor local()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER}) public final class method : kotlin.Annotation {
|
||||
public constructor method()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD}) public final class multiple : kotlin.Annotation {
|
||||
public constructor multiple()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.PACKAGE}) public final class packag : kotlin.Annotation {
|
||||
public constructor packag()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) public final class parameter : kotlin.Annotation {
|
||||
public constructor parameter()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER}) public final class type : kotlin.Annotation {
|
||||
public constructor type()
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package test
|
||||
|
||||
public interface ArrayOfEnumInParam {
|
||||
|
||||
public final class targetAnnotation : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FIELD, AnnotationTarget.CONSTRUCTOR}) public final class targetAnnotation : kotlin.Annotation {
|
||||
public constructor targetAnnotation(/*0*/ value: kotlin.String)
|
||||
public final val value: kotlin.String
|
||||
public abstract fun value(): kotlin.String
|
||||
|
||||
Reference in New Issue
Block a user