Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] enum wildcard value matching

In places within the syntax we support enum matching directly, for example an annotation value that is an enum:
aspect X {
  // Advise all methods marked @Trace except those with a tracelevel of none
  before(): execution(@Trace !@Trace(TraceLevel.NONE) * *(..)) {
    System.err.println("tracing "+thisJoinPoint);
  }
}
There are no enhancement requests open to go any further than this right now, feel free to open one.

cheers,
Andy.

2008/9/24 Mohan Radhakrishnan <radhakrishnan.mohan@xxxxxxxxx>
Hi,

Is this the only way to match a particular enum value ? I thought
there would be a enum wildcard value matching or something like that.

       @Pointcut(
       "execution(List<T> getSameValue()) && target(testEnum) && if()")
       public static boolean testPointcut1( TestEnum testEnum ){
               return testEnum == TestEnum.Value2;
       }

       @Before("testPointcut1(testEnum)")
       public void test1( TestEnum testEnum ) {
               System.out.println( "Generics aspect [" + testEnum.ordinal() + "]" );
       }

Thanks,
Mohan
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top