There are two issues here.  First, your annotations are on the field
yet you want to advise the methods.  You will either have to move your
annotations to the methods, or advise the field set.

The second part is to exclude all fields/methods with the annotation
on it.  Here is a way to do this with field sets

      public pointcut noAuditValueChange(AbstractBusinessEntity entity) :
        set ( @DoNotAudit * AbstractBusinessEntity +.*) && target(entity);

      public pointcut auditValueChange(AbstractBusinessEntity entity) :
        execution ( @DoNotAudit * AbstractBusinessEntity +.*) &&
target(entity) &&
        !noAuditValueChange(entity) ;

Note, I haven't tried this out, so the syntax might be slightly off.

Also, if you only want to advise field sets that occur within setter
methods, you can add a withincode clause to your pointcut.

--a
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to