/
CombinedTestModel.java
47 lines (36 loc) · 1.02 KB
/
CombinedTestModel.java
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
package org.reflections;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
interface CombinedTestModel {
@Retention(RUNTIME)
@interface Alias { String value();}
@Retention(RUNTIME)
@interface Requests {
Request[] value();
}
@Retention(RUNTIME)
@Repeatable(Requests.class)
@interface Request {
@Alias("path") String value() default "";
String method() default "";
}
@Retention(RUNTIME) @Request(method = "Get")
@interface Get { String value();}
@Retention(RUNTIME) @Request(method = "Post")
@interface Post { String value();}
@Request("/base")
interface Controller {
@Get("/get") void get();
@Post("/post")
void post(Object object);
}
abstract class Abstract implements Controller {
@Override public void get() {}
}
class Impl extends Abstract {
@Requests({@Request(method = "PUT", value = "/another"),
@Request(method = "PATCH", value = "/another")})
@Override public void post(Object object) {}
}
}