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.

NamedCrosscuts.java 617B

12345678910111213141516171819202122232425262728293031
  1. import org.aspectj.testing.Tester;
  2. public class NamedCrosscuts {
  3. crosscut fooCut(Foo f): void foo() && f;
  4. static advice(Foo f): fooCut(f) {
  5. before {
  6. System.err.println("before advice");
  7. }
  8. }
  9. crosscut allMethodsCut(): * && !(NamedCrosscuts) && !abstract * *(..);
  10. static advice(): allMethodsCut() {
  11. before {
  12. System.err.println("method: "+thisJoinPoint.methodName);
  13. }
  14. }
  15. public static void test() {
  16. new Foo().foo();
  17. }
  18. public static void main(String[] args) {
  19. test();
  20. }
  21. }
  22. class Foo {
  23. void foo() {}
  24. }