blob: cc8b9e8399243d0a41d054204b1b6c6e9a6e054a (
plain)
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
|
import java.lang.annotation.*;
interface Behavior {
String hello();
}
aspect Trait {
// public String Behavior.name;
public String Behavior.hello() throws java.io.IOException {
return "hello";
}
}
public class Target2 implements Behavior {
public static aspect A {
// declare @field: * Target2.name: @Tagged; // NO WORKY
declare @method: * Target2.hello(..): @Tagged; // NO WORKY
}
public static void main(String []argv) throws Exception {
System.out.println(Target2.class.getDeclaredMethod("hello").getDeclaredAnnotations()[0]);
}
}
@Retention(RetentionPolicy.RUNTIME)
@interface Tagged {}
|