org.hibernate.validator.resourceloading
Class CachingResourceBundleLocator

java.lang.Object
  extended by org.hibernate.validator.resourceloading.DelegatingResourceBundleLocator
      extended by org.hibernate.validator.resourceloading.CachingResourceBundleLocator
All Implemented Interfaces:
ResourceBundleLocator

public class CachingResourceBundleLocator
extends DelegatingResourceBundleLocator

A ResourceBundleLocator implementation that wraps around another locator and caches values retrieved from that locator.

Author:
Gunnar Morling, Kevin Pollet (C) 2011 SERLI

Constructor Summary
CachingResourceBundleLocator(ResourceBundleLocator delegate)
          Deprecated. Will be removed in a future release. Use CachingResourceBundleLocator(ResourceBundleLocator) instead.
CachingResourceBundleLocator(ResourceBundleLocator delegate)
          Creates a new CachingResourceBundleLocator.
 
Method Summary
 ResourceBundle getResourceBundle(Locale locale)
          Returns a resource bundle for the given locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingResourceBundleLocator

@Deprecated
public CachingResourceBundleLocator(ResourceBundleLocator delegate)
Deprecated. Will be removed in a future release. Use CachingResourceBundleLocator(ResourceBundleLocator) instead.

Creates a new CachingResourceBundleLocator.

Parameters:
delegate - The locator from which the values actually will be retrieved.

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: ResourceBundleLocator
Returns a resource bundle for the given locale.

Specified by:
getResourceBundle in interface ResourceBundleLocator
Overrides:
getResourceBundle in class DelegatingResourceBundleLocator
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.


Copyright © 2012 Oracle Corporation. All Rights Reserved.