What do you think of public class ConstraintValidatorContext { addInterpolatedParameter(String name, String value); }
public class SyntaxValidator implements ConstraintValidator<Syntax, String> { public boolean isValid(String value, ConstraintValidatorContext context) {
detectedSyntax = ...;context.addInterpolatedParameter("detectedSyntax", detextedSyntax);
return allowedSyntaxes.contains(detectedSyntax); } } @Syntax(value={JAVA, HTML}, message="{constraint.syntax}") String text; ValidatorMessage_en.properties constraint.syntax=Unable to support {detectedSyntax} => "Unable to support PHP"
_______________________________________________ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev