Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] inter-type removal

It would be handy to be able to control the runtime 'existence' of certain features across classes, specifically annotations but perhaps fields, interfaces, and other inter-type declarations. Physically removing these features during compile-time weaving would work for me, maybe in the annotation case directed by syntax like:

import org.jboss.seam.annotations.*;

public aspect RemoveSeamAnnotations {
 final static boolean NO_SEAM = true;
 declare @type : if(NO_SEAM) && @Name org.xyz.model..* : !@Name ;
 declare @field : if(NO_SEAM) && @In || @Out * * : !(@In || @Out)
}


The alternative (that I can think of anyway) would be advising

	execution(* java.lang.Class.*Annotation*(..))


and removing the Seam annotations from the return values of these methods, which seems messier.


Back to the top