I have a aspect to inject a value for a field:

    pointcut contextAccessed(Action action ):
        get( private com.example.api.IContext *.ctx ) && this(action) ;

    before(Action action ): contextAccessed(action) {
...

This is working fine so  far, and doing what I am expecting. However,
I need to inject IContext in more that one class. For example, I need
to define the pointcut to handle multiple classes. Currently, it's
processing "Action" class, but I want to add "Expression" class. I can
duplicate the code (copy/paste).

For example I am looking for something like (this wont work):

    pointcut contextAccessed(Action action   || Expression<?> expression):
        get( private com.example.api.IContext *.ctx ) && this(action) ;

    before(Action action   || Expression<?> expression ):
contextAccessed(action,expression) {
....

Is there a way to handle this case?
I am new to AspectJ, so an example would be highly appreciated.

Thank you in advance
_______________________________________________
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to