import java.lang.annotation.*; abstract aspect GA
{
/*
* test before advice with
- CflowPointcut
- annotation
- args annotation
- args
- this
- target
- @this
- @target
- @within
- @withincode
- parameter binding
*/
before(P p, Q q) : cflow(execution(* P.*(..)) && this(p)) && set(Q *) && args(q) {
System.out.println("cflow-ok " + p + " " + q + " " + thisJoinPoint);
}
before(A a) : execution(* *(..)) && @annotation(a) && !execution(* toString()){
System.out.println("@annotation-ok " + a + " " + thisJoinPoint);
}
before(A a) : execution(* *(..)) && @args(a) && !execution(* toString()){
System.out.println("@args-ok " + a + " " + thisJoinPoint);
}
before(P p) : execution(* *(..)) && args(..,p) && !execution(* toString()){
System.out.println("args-ok " + p + " " + thisJoinPoint);
}
before(Q q) : this(q) && execution(* *(..)) && !execution(* toString()){
System.out.println("this-ok " + q + " " + thisJoinPoint);
}
before(P p) : target(p) && execution(* *(..)) && !execution(* toString()){
System.out.println("target-ok " + p + " " + thisJoinPoint);
}
before(A a) : @this(a) && execution(* *(..)) && !execution(* toString()){
System.out.println("@this-ok " + a + " " + thisJoinPoint);
}
before(A a) : @target(a) && execution(* *(..)) && !execution(* toString()){
System.out.println("@target-ok " + a + " " + thisJoinPoint);
}
before(A a) : @within(a) && execution(* *(..)) && !execution(* toString()){
System.out.println("@within-ok " + a + " " + thisJoinPoint);
}
before(A a) : @withincode(a) && get(* *) {
System.out.println("@withincode-ok " + a + " " + thisJoinPoint);
}
}
aspect Sub extends GA