<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">What do you think of<div>public class ConstraintValidatorContext {</div><div>&nbsp;&nbsp; &nbsp;<b>addInterpolatedParameter(String name, String value);</b></div><div>}</div><div><br></div><div>public class SyntaxValidator implements ConstraintValidator&lt;Syntax, String> {</div><div>&nbsp;&nbsp; &nbsp;public boolean isValid(String value, ConstraintValidatorContext context) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;detectedSyntax = ...;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;context.addInterpolatedParameter("detectedSyntax", detextedSyntax);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return&nbsp;allowedSyntaxes.contains(detectedSyntax);</div><div>&nbsp;&nbsp; &nbsp;}</div><div>}</div><div><br></div><div>@Syntax(value={JAVA, HTML}, message="{constraint.syntax}")</div><div>String text;</div><div><br></div><div>ValidatorMessage_en.properties</div><div>constraint.syntax=Unable to support {detectedSyntax}</div><div><br></div><div><br></div><div>=></div><div>"Unable to support PHP"</div></div></body></html>