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 456B

1234567891011121314151617181920
  1. import java.lang.annotation.*;
  2. @Retention(RetentionPolicy.RUNTIME) @interface Ann {}
  3. aspect Aspect {
  4. before() : call(@Ann * *(..)) {
  5. System.out.println("\tJoin point: " + thisJoinPointStaticPart);
  6. }
  7. // Methods with out the Ann annotation but in an Ann annotated type get Ann
  8. declare @method: !@Ann * (@Ann *).*(..) : @Ann;
  9. }
  10. public class A {
  11. void foo() { new B().foo(); }
  12. public static void main(String[] args) { new A().foo(); }
  13. }