Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] How to declare an error when implementations of an interface doesn't supply a certain constructor

Hi

I'm trying to declare an error when implementations of a certain interface doesn't supply a certain constructor. I'm both having difficulty limiting the scope to only implementations of the interface (IOpen+) seems too large a granularity and specifying the constructor.

I've tried with this aspect:

public aspect OptionAspect {
declare error: staticinitialization(IOption+) && !execution(IOption+.new(OptionType)) : "IOption implementations must provide a constructor which accepts an OptionType";
}

Could you give me a pointer to what I'm missing/doing wrong?

Thanks in advance :)

/Jeppe



Back to the top