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.

B.java 556B

123456789101112131415161718192021222324252627282930313233
  1. import org.aspectj.lang.annotation.Aspect;
  2. import org.aspectj.lang.annotation.Before;
  3. import org.aspectj.lang.annotation.Pointcut;
  4. public class B {
  5. public static void main(String []argv) {
  6. System.out.println("B.main");
  7. }
  8. }
  9. @Aspect
  10. abstract class AbstractAzpect {
  11. @Pointcut
  12. public abstract void isTrue();
  13. @Before("isTrue() && execution(* B.main(..))")
  14. public void beforeFalse() {
  15. System.out.println("Azpect.beforeFalse");
  16. }
  17. }
  18. @Aspect
  19. class Azpect extends AbstractAzpect {
  20. @Override
  21. @Pointcut("if(true)")
  22. public void isTrue() { }
  23. }