Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] pointcut isInterface()

Hi Adriano.

I don't think this is possible with AspectJ right now, the primary
reason being that there's no way to distinguish subtyping as in
implementing an interface from subtyping as extending a class.

SCoPE may do the job though:
http://www.graco.c.u-tokyo.ac.jp/ppp/index.php?Projects%2Fscope

Eric

2008/5/20 Adriano Tavares <adriano.tavares@xxxxxxxxx>:
>
> Hi all,
> I need define static aspect to enforce directory only with interfaces.
> How to define a pointcut to enforce only interfaces?
>
> public aspect EnforceInterface {
>
>        pointcut inSpecificationDirectory() :
>                within(com.acme.spec..*);
>
>        pointcut isInterface() : <MUST BE INTERFACE> ;
>
>        declare error: inSpecificationDirectory() && !isInterface():
>        "Only interfaces in 'com.acme.spec..*' directory.";
> }
>
> any idea?
>
> Thanks in advance,
> Adriano Tavares.
> --
> View this message in context: http://www.nabble.com/pointcut-isInterface%28%29-tp17348400p17348400.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>



-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


Back to the top