forked from hacker85/JavaLessons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnotationLesson.java
More file actions
88 lines (74 loc) · 1.96 KB
/
AnotationLesson.java
File metadata and controls
88 lines (74 loc) · 1.96 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
package anotation;
import jdk.nashorn.internal.ir.annotations.Ignore;
import jdk.nashorn.internal.ir.annotations.Reference;
import javax.xml.ws.Action;
import java.lang.annotation.Annotation;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Ignore
public class AnotationLesson {
@Ignore
int i;
@Ignore
@Action
@Deprecated
public static void main(String[] args) {
@Ignore
int j;
}
//@Test(name = "test", run = false)
@Test("test")
//@Test(null)
//@MyAnnotation
@BugReport(reportedBy = {"one", "two"}, ref = @Reference())
//@BugReport(reportedBy = "One")
public @Ignore static void method(@Test("test") int i) {
}
}
//class Annotation2 extends AnotationLesson {
//
//}
@Inherited
@Retention(RetentionPolicy.RUNTIME)
//@Target({ElementType.FIELD, ElementType.LOCAL_VARIABLE})
abstract @interface Test { //Annotation
boolean run() default true;
String value();
//String name();
}
//@interface Test2 implements Test {
//
//}
class MyAnnotation implements Annotation {
@Override
public boolean equals(Object obj) {
return false;
}
@Override
public int hashCode() {
return 0;
}
@Override
public String toString() {
return null;
}
@Override
public Class<? extends Annotation> annotationType() {
return Annotation.class;
}
}
@interface BugReport {
enum Status { UNCONFIRMED, CONFIRMED, FIXED, NOTABUG };
boolean showStopper() default false;
String assignedTo() default "[none]";
String assigned2To() default "";
//String assignedTo() default "[none]" + new String("");
//String assignedTo() default null;
int i() default 1 + 1;
Class<?> testCase() default Void.class;
Status status() default Status.UNCONFIRMED;
Reference ref() default @Reference(); // an annotation type
String[] reportedBy();
//Object o();
}