You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

A.java 431B

123456789101112131415161718192021
  1. import java.lang.reflect.*;
  2. import java.lang.annotation.*;
  3. public class A {
  4. public static void main(String []argv) throws Exception {
  5. Method m = A.class.getDeclaredMethod("foo");
  6. printM(m);
  7. }
  8. private static void printM(Method m) {
  9. System.out.println(m.getName());
  10. Annotation[] as = m.getAnnotations();
  11. for (Annotation a: as) {
  12. System.out.println(a);
  13. }
  14. }
  15. }
  16. aspect X {
  17. public void A.foo() {}
  18. }