Class CachingResourceBundleLocator
- java.lang.Object
-
- org.hibernate.validator.resourceloading.DelegatingResourceBundleLocator
-
- org.hibernate.validator.resourceloading.CachingResourceBundleLocator
-
- All Implemented Interfaces:
ResourceBundleLocator
public class CachingResourceBundleLocator extends DelegatingResourceBundleLocator
AResourceBundleLocatorimplementation that wraps around another locator and caches values retrieved from that locator.- Author:
- Gunnar Morling, Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI
-
-
Constructor Summary
Constructors Constructor Description CachingResourceBundleLocator(ResourceBundleLocator delegate)Creates a new CachingResourceBundleLocator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceBundlegetResourceBundle(Locale locale)Returns a resource bundle for the given locale.
-
-
-
Constructor Detail
-
CachingResourceBundleLocator
public CachingResourceBundleLocator(ResourceBundleLocator delegate)
Creates a new CachingResourceBundleLocator.- Parameters:
delegate- The locator from which the values actually will be retrieved.
-
-
Method Detail
-
getResourceBundle
public ResourceBundle getResourceBundle(Locale locale)
Description copied from interface:ResourceBundleLocatorReturns a resource bundle for the given locale.- Specified by:
getResourceBundlein interfaceResourceBundleLocator- Overrides:
getResourceBundlein classDelegatingResourceBundleLocator- Parameters:
locale- A locale, for which a resource bundle shall be retrieved. Must not be null.- Returns:
- A resource bundle for the given locale. May be null, if no such bundle exists.
-
-