forked from paulirwin/JavaToCSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnnotationTest.java
More file actions
113 lines (91 loc) · 2.29 KB
/
Copy pathAnnotationTest.java
File metadata and controls
113 lines (91 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/// Expect:
/// - output: "0\n"
package example;
public @interface ComplexAnnotation
{
String[] arr();
int in();
String strDefault() default "";
}
public @interface SingleMemberAnnotation
{
String notValue();
}
public @interface SingleMemberAnnotationValue
{
String value();
}
public @interface MarkerAnnotation
{
}
public @interface SingleWithOtherValueDefault
{
String value();
String otherValue() default "";
}
public @interface SingleWithOtherValue
{
String value();
String otherValue();
}
public @interface SingleWithDefaultWithOther
{
String value() default "";
String otherValue() default "";
}
@Target({ElementType.ANNOTATION_TYPE, ElementType.FIELD, java.lang.annotation.ElementType.METHOD})
@Inherited
@Retention(RetentionPolicy.RUNTIME)
public @interface UsageAnnotation
{
}
@ComplexAnnotation(arr = {"enum"}, in = 5)
public enum SomeEn
{
VAL
}
public class Program
{
@ComplexAnnotation(arr = {"interface"}, in = 5)
@SingleMemberAnnotation(notValue = "value")
@SingleMemberAnnotationValue("value")
@SingleWithOtherValueDefault("Value")
@SingleWithOtherValue(value = "some", otherValue = "aaa")
@SingleWithDefaultWithOther
public interface SomeInter
{
@ComplexAnnotation(arr = {"interface", "method"}, in = 5)
void someMeth();
}
@ComplexAnnotation(in = 5, arr = {"class"})
@SingleWithOtherValueDefault(value = "Value", otherValue = "otherValue")
@SingleWithDefaultWithOther("value")
@MarkerAnnotation
public static class SomeEx
{
@ComplexAnnotation(arr = {"class", "constructor"}, in = 5)
public SomeEx()
{
}
}
@ComplexAnnotation(arr = {"a", "b"}, in = 2, strDefault = "300")
@SingleWithDefaultWithOther(value = "value", otherValue = "otherValue")
public static class SomeEx2
{
@ComplexAnnotation(arr = {"c", "d"}, in = 7, strDefault = "1000")
public SomeEx ex;
public SomeEx2(SomeEx ex)
{
this.ex = ex;
}
@ComplexAnnotation(arr = {"f", "e"}, in = 1, strDefault = "500")
@SingleWithDefaultWithOther(otherValue = "otherValue")
public void funcEx()
{
}
}
public static void main(String[] args)
{
System.out.println("0");
}
}