public class LocalizedMessageInterpolator
extends org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator
MessageInterpolator that is aware of a given Locale instead of using the default
one. Additionally, it uses an Application's default MessageSource to retrieve validation messages.| Constructor and Description |
|---|
LocalizedMessageInterpolator(Locale locale,
org.springframework.context.MessageSource messageSource)
Creates a new
LocalizedMessageInterpolator using the given Locale . |
| Modifier and Type | Method and Description |
|---|---|
String |
interpolate(String messageTemplate,
javax.validation.MessageInterpolator.Context context) |
interpolatepublic LocalizedMessageInterpolator(Locale locale, org.springframework.context.MessageSource messageSource)
LocalizedMessageInterpolator using the given Locale .locale - The Locale to use.messageSource - An additional MessageSource to use. If this is an instance of
AbstractResourceBasedMessageSource,
AbstractResourceBasedMessageSource.getBasenameSet() is being used to create a new
ResourceBundleMessageSource with these base names. This is necessary because a the
messageSource might use
MessageSourceSupport.setAlwaysUseMessageFormat(boolean), which can't properly be
handled by MessageInterpolator.Copyright © 2011–2021 aiticon GmbH. All rights reserved.