Change By: Gunnar Morling (30/Nov/12 2:50 AM)
Description: Based on a [question|http://stackoverflow.com/questions/13623556/] on stackoverflow, there seem to be use cases for setting message parameters dynamically, e.g. to put a dynamically determined valid value into the message:

{code}
@Future
private Date shippingDate;
{code}

{code}
public class MyFutureValidator implements ConstraintValidator<Future, Date> {

    public void initialize(Future constraintAnnotation) {}

    public boolean isValid(Date value, ConstraintValidatorContext context) {

        Date now = ...;

        if( value.after( now ) ) {

            context.disableDefaultConstraintViolation();
            context
                .buildConstraintViolationWithTemplate("Must be after {now}")
                .setValue( "now", now )
                .addConstraintViolation();

            return false;
        }

        return true;
    }
}
{code}

If we don't find enough time for this, we should at least add an {{unwrap()}} method on {{ConstraintValidatorContext}} to allow for provider specific implementations.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira