123456789101112131415161718192021222324252627282930313233343536 |
- import org.aspectj.lang.annotation.*;
-
- public class Basic3b {
- public static void main(String []argv) {
- Basic3b b = new Basic3b();
- if (!(b instanceof X.I)) throw new RuntimeException("Basic3b should implement I");
- ((X.I)b).m2();
- ((X.I)b).m3();
- ((X.I)b).m2();
- ((X.I)b).m4();
- }
- }
-
-
-
- @Aspect class X {
-
- interface I {
- }
-
- class IIimpl implements I {
- public void m2() { }
- public void m3() { }
- public void m4() { }
- }
-
-
- @DeclareParents("Basic3b",defaultimpl="IImpl")
- private I simplefield;;
-
-
- @Before("call(* *(..))")
- public void advice1() {}
-
- }
-
|