So one would have to specify the constraint like this when wishing to use the new reg-exp, right:
@URL(regexp=RFC_3987_REGEXP, regexpOnly=true)
I don't know, but this really looks too verbose to me. As a user, I'd then rather use @Pattern:
@Pattern(regexp=RFC_3987_REGEXP)
Switching between current and new behavior is something I'd want to do once for all @URL constraints, not for each single constraint instance.
How about one of the following:
-
Offer a global configuration property for changing the validation behavior from current to the new reg-exp based approach
-
Offer a new constraint, e.g. @Url2, @Rfc3987Url etc.
|