Top Description Fields Constructors Methods
org.hibernate.validator.resourceloading

public Class CachingResourceBundleLocator

extends DelegatingResourceBundleLocator
Class Inheritance
Imports
java.util.Locale, .ResourceBundle, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, org.hibernate.validator.spi.resourceloading.ResourceBundleLocator

A ResourceBundleLocator implementation that wraps around another locator and caches values retrieved from that locator.
Authors
Gunnar Morling, Kevin Pollet <[email protected]> (C) 2011 SERLI

Field Summary

Modifier and TypeField and Description
private final ConcurrentMap<Locale, ResourceBundle>

Constructor Summary

AccessConstructor and Description
public
CachingResourceBundleLocator(ResourceBundleLocator
The locator from which the values actually will be retrieved.
delegate
)

Creates a new CachingResourceBundleLocator.

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
)

Overrides org.hibernate.validator.resourceloading.DelegatingResourceBundleLocator.getResourceBundle.

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

Returns a resource bundle for the given locale.

Field Detail

bundleCacheback to summary
private final ConcurrentMap<Locale, ResourceBundle> bundleCache

Constructor Detail

CachingResourceBundleLocatorback to summary
public CachingResourceBundleLocator(ResourceBundleLocator delegate)

Creates a new CachingResourceBundleLocator.

Parameters
delegate:ResourceBundleLocator

The locator from which the values actually will be retrieved.

Method Detail

getResourceBundleback to summary
public ResourceBundle getResourceBundle(Locale locale)

Overrides org.hibernate.validator.resourceloading.DelegatingResourceBundleLocator.getResourceBundle.

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