[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[aspectj-users] Question on compile-time pointcut evaluation
- From: Holger Hoffstätte <holger@xxxxxxxxxx>
- Date: Thu, 02 Feb 2006 13:45:48 +0100
- Delivered-to: email@example.com
- User-agent: Thunderbird 1.5 (Windows/20051201)
While introducing some policy aspects into an application I've come across
an interesting problem, similar to a recent discussion. The situation is
- 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
Any ideas? Did I miss something obvious, or is this just not possible?