[
http://opensource.atlassian.com/projects/hibernate/browse/BVAL-202?page=c...
]
Emmanuel Bernard edited comment on BVAL-202 at 3/15/10 10:40 AM:
-----------------------------------------------------------------
Solution #3
Let constraints not defining a ConstraintValidator<Constraint, Iterable<?>>
(or any of the Iterator subclasses) be applied on the collection elements. This works well
as applying such a constraint today on a Iterable<?> raises a runtime exception.
Use solution #1 or #2 for constraints that do declare a ConstraintValidator<Constraint,
Iterable<?>>
{code}@NotNull
@Size(max=30)
@Size(max=50, validElements=true)
@Email
Collection<String> emails;{code}
was (Author: emmanuel):
Solution #3
Let constraints not defining a ConstraintValidator<Constraint, Iterable<?>>
(or any of the Iterator subclasses) be applied on the collection elements. This works well
as applying such a constraint today on a Iterable<?> raises a runtime exception.
Use solution #1 or #2 for constraints that do declare a ConstraintValidator<Constraint,
Iterable<?>>
@NotNull
@Size(max=30)
@Size(max=50, validElements=true)
@Email
Collection<String> emails;
Apply constraints on the elements of an iterator
------------------------------------------------
Key: BVAL-202
URL:
http://opensource.atlassian.com/projects/hibernate/browse/BVAL-202
Project: Bean Validation
Issue Type: New Feature
Components: spec-general
Reporter: Emmanuel Bernard
Assignee: Hardy Ferentschik
The use case is the ability to ask a constraint to be applied, not on the annotated
element itself but on the elements contained by the annotated element (typically an
Iterator). Hardy and I have been discussing various options. I will list them in various
comments
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira