[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Question on compile-time pointcut evaluation

Hi,

While introducing some policy aspects into an application I've come across
an interesting problem, similar to a recent discussion. The situation is
as follows:

- client classes may use some other objects' declared interface methods
- this interface is known to extend from a known parent super-interface
- the interface must be implemented at least once, though several
implementations are OK too. A nonexisting class will properly explode at
runtime but I want some compile-time checking.

The problem is that this restriction is supposed to fire at compile time
via declare warning/error, but so far been I have been unable to come up
with pointcuts that match the "empty difference" (meaning: no class
implements the interface) between several matching pointcut "result sets".
I thought about argument designations via this/target (making the matching
class the argument) but they do not seem to be allowed with lexical
pointcuts; I had hoped for at least some compile-time evaluation
possibilities. The selecting of only the subinterface, all classes that do
not implement it or the superinterface etc. is no problem in itself and
works fine.
Any ideas? Did I miss something obvious, or is this just not possible?

thanks,
Holger