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
|
// Use all the variants of annotations - to exercise the
// eclipse transform code in EclipseSourceType
import java.lang.annotation.*;
@AnnotationStringElement(stringval="hello")
@SimpleAnnotation(id=1)
@AnnotationClassElement(clz=Integer.class)
@CombinedAnnotation({@SimpleAnnotation(id=4)})
@AnnotationEnumElement(enumval=SimpleEnum.Red)
@ComplexAnnotation(ival=4,bval=2,cval='5',fval=3.0f,dval=33.4,zval=false,jval=56,sval=99)
public class DecoratedClass {
public void m() {}
}
@Target(value={ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@interface SimpleAnnotation {
int id();
String fruit() default "bananas";
}
enum SimpleEnum { Red,Orange,Yellow,Green,Blue,Indigo,Violet };
@Retention(RetentionPolicy.RUNTIME)
@interface SimpleStringAnnotation {
String fruit();
}
@Target({ElementType.TYPE,ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@interface AnnotationClassElement {
Class clz();
}
@Retention(RetentionPolicy.RUNTIME)
@interface AnnotationEnumElement {
SimpleEnum enumval();
}
@Target({ElementType.TYPE,ElementType.METHOD,ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@interface AnnotationStringElement {
String stringval();
}
@Retention(RetentionPolicy.RUNTIME)
@interface CombinedAnnotation {
SimpleAnnotation[] value();
}
@Retention(RetentionPolicy.RUNTIME)
@interface ComplexAnnotation {
int ival();
byte bval();
char cval();
long jval();
double dval();
boolean zval();
short sval();
float fval();
}
|