Top Description Fields Constructors Methods
org.springframework.validation.beanvalidation

public Class MessageSourceResourceBundleLocator

extends Object
implements ResourceBundleLocator
Class Inheritance
All Implemented Interfaces
org.hibernate.validator.spi.resourceloading.ResourceBundleLocator
Imports
java.util.Locale, .ResourceBundle, org.hibernate.validator.spi.resourceloading.ResourceBundleLocator, org.springframework.context.MessageSource, org.springframework.context.support.MessageSourceResourceBundle, org.springframework.util.Assert

Implementation of Hibernate Validator 4.3/5.x's ResourceBundleLocator interface, exposing a Spring MessageSource as localized MessageSourceResourceBundle.
Author
Juergen Hoeller
Since
3.0.4
See Also
ResourceBundleLocator, MessageSource, MessageSourceResourceBundle

Field Summary

Modifier and TypeField and Description
private final MessageSource

Constructor Summary

AccessConstructor and Description
public
MessageSourceResourceBundleLocator(MessageSource
the Spring MessageSource to wrap
messageSource
)

Build a MessageSourceResourceBundleLocator for the given MessageSource.

Method Summary

Modifier and TypeMethod and Description
public ResourceBundle
getResourceBundle(Locale
A locale, for which a resource bundle shall be retrieved. Must not be null.
locale
)

Implements org.hibernate.validator.spi.resourceloading.ResourceBundleLocator.getResourceBundle.

Returns a resource bundle for the given locale.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

messageSourceback to summary
private final MessageSource messageSource

Constructor Detail

MessageSourceResourceBundleLocatorback to summary
public MessageSourceResourceBundleLocator(MessageSource messageSource)

Build a MessageSourceResourceBundleLocator for the given MessageSource.

Parameters
messageSource:MessageSource

the Spring MessageSource to wrap

Method Detail

getResourceBundleback to summary
public ResourceBundle getResourceBundle(Locale locale)

Implements org.hibernate.validator.spi.resourceloading.ResourceBundleLocator.getResourceBundle.

Doc from org.hibernate.validator.spi.resourceloading.ResourceBundleLocator.getResourceBundle.

Returns a resource bundle for the given locale.

Parameters
locale:Locale

A locale, for which a resource bundle shall be retrieved. Must not be null.

Returns:ResourceBundle

A resource bundle for the given locale. May be null, if no such bundle exists.

Annotations
@Override