for persistence i want to use field injection
as for the exceptions, i'm not a fan of preventive exceptions. throw only an exception when you have to. otherwise you always end up in situations where you want to do something strange to make it work and then you're blocked by some exception.
also, since all of the code is under our control, it is another reason why i don't think boolean discriptor null checking should require an exception. i mean that the parsers that create the boolean descriptor is written by us, not users of our code. if we test that properly, we don't need the extra kilobytes of jar for checking all these things.
when thinking of exceptions, always put yourself in the perspective of the client. what kind of exception does he need to see ? in this case, it's an exception that the client should never see.
Do you mean we should remove the Exception from Constructors ?
This way we would have the same behavior in constructors and in the setter methods (and the user will never get this kind of exception when creating context).
(ah... only now i saw that i did the original check and exception throwing :)
indeed. using only default constructors in combination with plain setters is better.
if you want you can bring the descriptors all in sync with that approach.