Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Iterate over all Join Points of a Pointcut?

No. - At least not in the way you described it. Joinpoints are a dynamic
thing, so you cannot iterate over them.

What you *can* do is:

1.) Write an aspect that advises class initialization.
2.) Use ordinary Java reflection to iterate over all the members of this
class.
3.) While doing so, filter for members with certain annotations.

Eric  

--
Eric Bodden
Sable Research Group, McGill University
Montreal, Canada 


> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx 
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of 
> Sebastian.Baltes@xxxxxxxxxx
> Sent: Tuesday, February 21, 2006 4:35 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] Iterate over all Join Points of a Pointcut?
> 
> Is it possible to iterate over all Join Points of a Pointcut?
> 
> For example something like:
> 
> pointcut pc: call(@Special * *(..))
> 
> public void listSpecials() {
>   System.out.println("All special methods:");
>   for (JointPoint jp : pc) {
>     System.out.println("> "+jp);
>   }
> }
> 
> Best Regards,
> Sebastian Baltes
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 


Back to the top