public class LocaleContextMessageInterpolator extends java.lang.Object implements MessageInterpolator
MessageInterpolator
implementation but enforces Spring's
managed Locale. Typically used to wrap the validation provider's default interpolator.LocaleContextHolder.getLocale()
MessageInterpolator.Context
Constructor and Description |
---|
LocaleContextMessageInterpolator(MessageInterpolator targetInterpolator)
Create a new LocaleContextMessageInterpolator, wrapping the given target interpolator.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
interpolate(java.lang.String message,
MessageInterpolator.Context context) |
java.lang.String |
interpolate(java.lang.String message,
MessageInterpolator.Context context,
java.util.Locale locale) |
public LocaleContextMessageInterpolator(MessageInterpolator targetInterpolator)
targetInterpolator
- the target MessageInterpolator to wrappublic java.lang.String interpolate(java.lang.String message, MessageInterpolator.Context context)
interpolate
in interface MessageInterpolator
public java.lang.String interpolate(java.lang.String message, MessageInterpolator.Context context, java.util.Locale locale)
interpolate
in interface MessageInterpolator