Wonder if there is a way with generics - have you tried it? (parameterized super aspect). Have the pointcut refer to generics in the supertype then fill it in in the subaspect?
In some ways this sounds like a variant of named type patterns, where something common across a set of pointcuts can be pulled out and defined as a single thing. Named signature patterns (if we had those) would get you some of the way but because you are using method and field joinpoints which have different signatures it wouldn't completely solve it. Actually I'm convincing myself more and more that generics is the right answer. I just can't recall the extent to which type variables are allowed in pointcuts. Andy On 7 October 2013 22:56, Matthew Adams <matt...@matthewadams.me> wrote: > If I have a pointcut like the following: > > public aspect TypeSpecificAspect { > public pointcut accessingTarget(): > call(Person+.new(..)) || call(* Person+.*(..)) || get(* Person+.*) || > set(* Person+.*); > } > > I'd like to push the pointcut up into a superaspect so that all the > subaspect would have to supply is the actual type expression (in this case, > Person). Something like the following: > > public aspect Super { > public abstract pointcut theType(); > public pointcut accessingTarget(): /* demonstrating the point -- doesn't > compile */ > call(thisType()+.new(..)) || call(* thisType()+.*(..)) || get(* > thisType()+.*) || set(* thisType()+.*); > } > ===== > public aspect Sub extends Super { > public pointcut theType(): Person; > } > > How can I achieve what I hope you understand I mean? > > Thanks, > Matthew > -- > mailto:matt...@matthewadams.me <matt...@matthewadams.me> > skype:matthewadams12 > googletalk:matt...@matthewadams.me > http://matthewadams.me > http://www.linkedin.com/in/matthewadams > > _______________________________________________ > aspectj-users mailing list > aspectj-users@eclipse.org > https://dev.eclipse.org/mailman/listinfo/aspectj-users > >
_______________________________________________ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users