I need to inject few methods to every initialized object using AspectJ.
I thought using this :
pointcut vistaInjection(Object o)
: initializati
Have you tried
pointcut vistaInjection(Object o)
: (initialization(*.new()) || (initialization(*.new(..)))
&& target(o)
&& !within(objectAspect);
i.e. calling .new()
on anything and allowing no and some arguments.
Note - you probably don't want to pick up all object creations.. what are you planning on doing with them!