com.taco.util
Class AccessibleResourceBundleAdapter

java.lang.Object
  extended by java.util.ResourceBundle
      extended by com.taco.util.AccessibleResourceBundle
          extended by com.taco.util.CachedKeysResourceBundle
              extended by com.taco.util.AccessibleResourceBundleAdapter
Direct Known Subclasses:
ChainedResourceBundleFactory.ChainedResourceBundle

public class AccessibleResourceBundleAdapter
extends CachedKeysResourceBundle

Adapts an ordinary resource bundle to be an AccessibleResourceBundle. This requires that the adapted bundle's parent is null. However, this cannot be verified.


Field Summary
protected  java.util.ResourceBundle _bundle
          The bundle adapted by this instance.
 
Fields inherited from class com.taco.util.CachedKeysResourceBundle
_cachedKeySet, _keySetRef, _useSoftCache
 
Fields inherited from class com.taco.util.AccessibleResourceBundle
_isParentSet, _locale
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
AccessibleResourceBundleAdapter(java.util.ResourceBundle bundle)
          Create a new instance that adapts the argument bundle and uses a soft cache for its keys.
AccessibleResourceBundleAdapter(java.util.ResourceBundle bundle, boolean useSoftCache)
          Create a new instance that adapts the argument bundle.
 
Method Summary
protected  java.util.Iterator _getProperKeys()
          Return the keys of the decorated bundle.
protected  java.lang.Object handleGetObject(java.lang.String key)
          Dispatch to the adapted bundle's getObject() method.
static AccessibleResourceBundle makeAccessibleBundle(java.util.ResourceBundle bundle)
          Given a resource bundle, return either the bundle itself, if it is an instance of AccessibleResourceBundle, or an adapted version of it which is an AccessibleResourceBundle.
 
Methods inherited from class com.taco.util.CachedKeysResourceBundle
getKeys, getUseSoftCache, invalidateCache, setUseSoftCache
 
Methods inherited from class com.taco.util.AccessibleResourceBundle
getLocale, getParent, setLocale, setParent
 
Methods inherited from class java.util.ResourceBundle
getBundle, getBundle, getBundle, getObject, getString, getStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_bundle

protected final java.util.ResourceBundle _bundle
The bundle adapted by this instance.

Constructor Detail

AccessibleResourceBundleAdapter

public AccessibleResourceBundleAdapter(java.util.ResourceBundle bundle)
Create a new instance that adapts the argument bundle and uses a soft cache for its keys.


AccessibleResourceBundleAdapter

public AccessibleResourceBundleAdapter(java.util.ResourceBundle bundle,
                                       boolean useSoftCache)
Create a new instance that adapts the argument bundle. If useSoftCache is true, use a soft cache for the keys. Otherwise, use a hard cache.

Method Detail

handleGetObject

protected java.lang.Object handleGetObject(java.lang.String key)
Dispatch to the adapted bundle's getObject() method.

Specified by:
handleGetObject in class java.util.ResourceBundle

_getProperKeys

protected java.util.Iterator _getProperKeys()
Return the keys of the decorated bundle.

Specified by:
_getProperKeys in class CachedKeysResourceBundle

makeAccessibleBundle

public static AccessibleResourceBundle makeAccessibleBundle(java.util.ResourceBundle bundle)
Given a resource bundle, return either the bundle itself, if it is an instance of AccessibleResourceBundle, or an adapted version of it which is an AccessibleResourceBundle.