Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: Access-modifier pattern for package visibility

Hello,

thanks for your answer.

> Good guess.  Here's a snippet from
>   aspectj-1.5\doc\aspectjlib\src\org\aspectj\lib\pointcuts\Pointcuts.java:
> 
>     public pointcut anyPackageProtectedMethodExecution() :
>         execution(!private !public !protected * *(..));

So the only way to catch public and protected methods would be:
     public pointcut publicProtectedExecution() :
         execution(public * *(..) || protected * *(..));
I hoped there was something nicer (like "(public||protected) * *(..)").

> You can pretty easily write small test programs to validate your guesses.
You are absolutly right. But then - who knows if the compiler is standard
compliant? ;-) I'd rather have a clear spec (or response on a mailing list)
than having to try things out. Besides I wanted to know if there is no
other (better) way to do this.

> btw, I wouldn't use CVS to access the docs.  From
> 
>   http://www.eclipse.org/aspectj/docs.php
That's what google gave me. I did try to locate the grammar rule in an
offical document, but I wasn't able to find it. Googling
for "site:www.eclipse.org/aspectj/doc/ modifiersPattern" does not point me
to any document were I can find the same grammer rule. 
In fact the rule from the official doc (e.g.
http://www.eclipse.org/aspectj/doc/next/progguide/printable.html) is very
misleading (not to say wrong):

MethodPattern = 
  [ModifiersPattern] TypePattern
<snip>
ModifiersPattern =
  [ ! ] JavaModifier  ...

I would love to see a full grammar for AspectJ at one place!

Best regards 

Ben



Back to the top