Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Accessing members in anonymous inner classes

Matthew,

Assuming that works, it would capture all the visit() methods defined
by implementors of IResourceVisitor. I want to capture one specific
definition of the visit() method defined by a specific class, say, C.
Any ideas?

Thank you!

Cheers,
Fernando

On 11/14/05, Matthew Webster <matthew_webster@xxxxxxxxxx> wrote:
>
> Fernando,
>
> How about "execution(public boolean visit(IResource innerResource)) &&
> this(IResourceVisitor)"?
>
> Matthew Webster
>  AOSD Project
>  Java Technology Centre, MP146
>  IBM Hursley Park, Winchester,  SO21 2JN, England
>  Telephone: +44 196 2816139 (external) 246139 (internal)
>  Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
> http://w3.hursley.ibm.com/~websterm/
>
> Please respond to aspectj-users@xxxxxxxxxxx
>
> Sent by:        aspectj-users-bounces@xxxxxxxxxxx
>
> To:        aspectj-users@xxxxxxxxxxx
> cc:
> Subject:        [aspectj-users] Accessing members in anonymous inner classes
>
>
> Hi everyone,
>
>  I am having some trouble trying to select via PCDs methods defined by
>  anonymous inner classes. For example, in the snippet below, how do I
>  select the visit() method without selecting all the methods named
>  visit() ?
>
>  try {
>                  resource.accept(new IResourceVisitor() {
>                                   public boolean visit(IResource
> innerResource) throws CoreException {
>                                                    try {
>
> Policy.checkCanceled(monitor);
>                                                                     if
> (innerResource.getType() != IResource.FILE) {
>                                     ... // does something
>                                                                     }
>                                                                     if
> (isOutOfSync(innerResource, monitor)) {
>
>         SyncInfo info = getSyncInfo(innerResource);
>
>         if (info != null && info.getKind() != 0) {
>
>                          set.add(info);
>
>         }
>                                                                     }
>                                                    } catch (TeamException e)
> {
>                             .... // handles the exception
>                                                    }
>                                                    return true;
>                                   }
>                  }, depth, true /* include phantoms */);
>  }
>
>  Thanks!
>
>  Cheers,
>  Fernando
>  _______________________________________________
>  aspectj-users mailing list
>  aspectj-users@xxxxxxxxxxx
>  https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>
>
>
>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>


Back to the top