com.arsdigita.globalization
Class ChainedResourceBundle
java.lang.Object
java.util.ResourceBundle
com.arsdigita.globalization.ChainedResourceBundle
- public class ChainedResourceBundle
- extends ResourceBundle
This is a ResourceBundle that allows the developer to add additional
ChainableResourceBundles to it. Then, when the bundle is asked for
a key, it checks the ChainableResourceBundles in the order that they
were added. A typical use would be something like this
public class EventResourceBundle extends ChainedResourceBundle {
public EventResourceBundle() {
super();
addBundle((PropertyResourceBundle)getBundle("EVENT_BUNDLE_NAME"));
addBundle((PropertyResourceBundle)getBundle("DEFAULT_BUNDLE_NAME"));
}
}
Method Summary |
void |
addBundle(ChainableResourceBundle bundle)
This adds bundles to this chained resource. |
void |
addBundle(ListResourceBundle bundle)
this wraps the PropertyResourceBundle in a ChainableResourceBundle
and then delegates to addBundle(ChainableResourceBundle bundle); |
void |
addBundle(PropertyResourceBundle bundle)
this wraps the PropertyResourceBundle in a ChainableResourceBundle
and then delegates to addBundle(ChainableResourceBundle bundle); |
Enumeration |
getKeys()
|
Object |
handleGetObject(String key)
Because this particular bundle is just a wrapper around other bundles,
this method will return null so that the ResourceBundle can then
examine the values returned by the chained parents |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChainedResourceBundle
public ChainedResourceBundle()
addBundle
public void addBundle(PropertyResourceBundle bundle)
- this wraps the PropertyResourceBundle in a ChainableResourceBundle
and then delegates to addBundle(ChainableResourceBundle bundle);
addBundle
public void addBundle(ListResourceBundle bundle)
- this wraps the PropertyResourceBundle in a ChainableResourceBundle
and then delegates to addBundle(ChainableResourceBundle bundle);
addBundle
public void addBundle(ChainableResourceBundle bundle)
- This adds bundles to this chained resource. The bundles
are examined for the key in the order that they are added.
handleGetObject
public Object handleGetObject(String key)
- Because this particular bundle is just a wrapper around other bundles,
this method will return null so that the ResourceBundle can then
examine the values returned by the chained parents
getKeys
public Enumeration getKeys()
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC