Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Annotation parameter pointcut question

Hi,

Let's imagine I have two following annotations :

public @interface XAnnotation {

int    xid() default 0;
}

public @interface YAnnotation {

 int    yid() default 0;
}

This  works fine:
(1) pointcut myPointcut():  execution( @XAnnotation(xid = 2) * *(..)) ;

(2) So does this:
pointcut myPointcut():  execution( @YAnnotation  * *(..)) ;

(3) So does this:
pointcut myPointcut():  execution( @(XAnnotation || YAnnotation) * *(..)) ;
But, I don't manage to make this one:
(4) pointcut myPointcut():  execution( @(XAnnotation(xid = 2) || YAnnotation(yid=3)) * *(..)) ;

I use this as workaround though:
(5)  pointcut myPointcut1():  execution( @XAnnotation(xid = 2) * *(..)) ;
pointcut myPointcut2():  execution( @YAnnotation(yid=3) * *(..)) ;
pointcut myPointcut3(): myPointcut1()  || myPointcut2();

Is (4) not supported or do I miss something in writing the pointcut ?

Thanks,
Anwar.




Back to the top