mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-14 14:11:27 +02:00
22 lines
431 B
Java
22 lines
431 B
Java
import java.lang.reflect.*;
|
|
import java.lang.annotation.*;
|
|
|
|
public class A {
|
|
public static void main(String []argv) throws Exception {
|
|
Method m = A.class.getDeclaredMethod("foo");
|
|
printM(m);
|
|
}
|
|
|
|
private static void printM(Method m) {
|
|
System.out.println(m.getName());
|
|
Annotation[] as = m.getAnnotations();
|
|
for (Annotation a: as) {
|
|
System.out.println(a);
|
|
}
|
|
}
|
|
}
|
|
|
|
aspect X {
|
|
public void A.foo() {}
|
|
}
|