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.

TestBean.java 525B

1234567891011121314151617181920212223242526
  1. // simple version - we go bang if Impl doesnt implement I...
  2. package a.b.c;
  3. import org.aspectj.lang.annotation.*;
  4. interface I { public void m(); }
  5. class Impl implements I {
  6. public Impl() {}
  7. public void m() {}
  8. }
  9. @Aspect
  10. class TestBeanAdvice {
  11. @DeclareParents(value="a.b.c.TestBean", defaultImpl=a.b.c.Impl.class)
  12. private I implementationInterface;
  13. }
  14. public class TestBean {
  15. public static void main(String []argv) throws Exception {
  16. ((I)new TestBean()).m();
  17. }
  18. }
  19. class BeansException extends Exception {}