[bv-dev] BVAL-192 'exclusive' flag for @DecimalMin/@DecimalMax

Hardy Ferentschik hardy at hibernate.org
Mon Dec 10 17:53:45 EST 2012


Hi,

Seem Michael's and Emmanuel's suggestions are related to BVAL-223 [1].

Regarding this issue I had so far a much simpler improvement of the message interpolation in mind. Something along the lines of Hibernate Validator's
ValueFormatterMessageInterpolator [2]. There the idea is that parameters can be formatted with the syntax supported by String#format and
the validated value itself becomes interpolatable as well. Something like '${validatedValue: '%1$5f' }'.

I also like the approach taken in OVal. There you can create/change message variables by overriding 'Map<String, String> createMessageVariables()'. 
Something like this could for example be added to ConstraintValidatorContext. 

Obviously this does not solve yet the conditional logic required for the @DecimalMin/Max. Is it realistic that we agree on a syntax for inclusion into
BV 1.1 given the current time frame? Is there a syntax out there we could base it on.


--Hardy


[1] https://hibernate.onjira.com/browse/BVAL-223
[2] https://github.com/hibernate/hibernate-validator/blob/master/engine/src/main/java/org/hibernate/validator/messageinterpolation/ValueFormatterMessageInterpolator.java



On 10 Jan 2012, at 4:17 PM, Michael Nascimento <misterm at gmail.com> wrote:

> Yes, I think we need to improve on the message format as you suggested
> to include conditional formatting statements (maybe a ternary?).
> 
> Regards,
> Michael
> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev




More information about the beanvalidation-dev mailing list