hibernate/hibernate-validator — pull request #360 by NicolaF (2014-12-23 14:10:45+00:00)
Title: HV-951: Make expression variables added via context.addExpressionVariable(String, Object) accessible from the ConstraintViolation object.

This commit adds a new getExpressionVariables() getter to ConstraintViolationImpl and minor changes to the internals:
* add an argument to ConstraintViolationImpl private constructor
* overload ConstraintViolationImpl.forBeanValidation & co. to handle the new constructor argument, and mark previous, overloaded ones as @Deprecated
* adjust ValidationContext.createConstraintViolation(ValueContext, ConstraintViolationCreationContext, ConstraintDescriptor) to pass expressionVariables as un unmodifiable Map to the overloaded builders
* unit test :p

Useful for:
* Single page web applications, when all i18n/l10n/interpolation stuff is handled client side in JS.
* Web services, where we want to expose constraint violations in a parsable way. WS client may present the error to users, depending on their prefered locale, and do the interpolation itself.