com.arsdigita.globalization
Class ChainedResourceBundle

java.lang.Object
  extended byjava.util.ResourceBundle
      extended bycom.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"));
    }
  }

  


Field Summary
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
ChainedResourceBundle()
           
 
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.util.ResourceBundle
getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainedResourceBundle

public ChainedResourceBundle()
Method Detail

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 20 2004:2337 UTC