com.taco.util
Class AccessibleResourceBundleAdapter
java.lang.Object
java.util.ResourceBundle
com.taco.util.AccessibleResourceBundle
com.taco.util.CachedKeysResourceBundle
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 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 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 |
_bundle
protected final java.util.ResourceBundle _bundle
- The bundle adapted by this instance.
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.
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
.