[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] point cut on:: Annotated field + new ArrayList()
|
The proceed() call in the around advice proceeds to do whatever was intended at the join point originally. Because it is a 'set' join point, the proceed will proceed to set the field being intercepted, so if we supply a different value in the proceed call, the field will be set to that instead.
Andy
2009/6/27 Ravi Chandra
<ravi.eze@xxxxxxxxx>
This way you are pointcutting the field variable. How does it return/ set the variable to new MyList() back?. In other words if i say
System.out.println('class::' + u.alias.getClass() );// we are point cutting u.alias variable
its not printing MyList; instead its showing ArrayList.
any ideas?
Are ther any standard tutorials available on the net by which we can get such problems clarified? Googling hardly helps. Any ideas/ links... kindly help.
ravi
Here is a working solution:
public aspect INAspect {
pointcut listCut(ArrayList value, LIST in ) : set(@LIST * * ) && args(value) && @annotation(in);
void around(ArrayList value, LIST in) :listCut(value,in) {
System.out.println("**annotation " + thisJoinPoint + " ann:" + in.value());
proceed(new MyList(),in);
}
}
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users