Hi,
I recently thought about adding a constraint @NoNullElements to Hibernate
Validator. It would apply to iterables/arrays/maps and would ensure, well,
that the annotated collection contains no nulls.
There is a method noNullElements() in Commons Lang's Validator class, which
I find useful quite often. OTOH this comes at the cost of doing an iteration
over the collection, so people could refrain from using it and check each
element for null themselves when iterating.
I also thought about adding some flag to the existing @NotEmpty constraint,
which could enable this check. But @NotEmpty also applies to strings, for
which such flag would not make sense very much.
Any ideas on that?
Thanks, Gunnar