net.rim.device.api.i18n
Class ResourceBundleFamily

java.lang.Object
  |
  +--net.rim.device.api.i18n.ResourceBundle
        |
        +--net.rim.device.api.i18n.ResourceBundleFamily

public class ResourceBundleFamily
extends ResourceBundle

A ResourceBundle that contains a collection of ResourceBundles.


Method Summary
 ResourceBundle getBundle(Locale locale)
          Retrieves bundle by locale.
protected  Object handleGetObject(int key)
          Retrieves resource object handle by integer key.
 boolean isEmpty()
          Determines if this bundle family contains no resource bundles.
 void put(Locale locale, ResourceBundle bundle)
          Adds a resource bundle to this bundle family.
 
Methods inherited from class net.rim.device.api.i18n.ResourceBundle
getBundle, getBundle, getFamily, getLocale, getObject, getObject, getString, getStringArray
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBundle

public ResourceBundle getBundle(Locale locale)
Retrieves bundle by locale.

This method returns the resource bundle associated with a locale. If not present, this method returns the closest parent resource, and if still not present, returns null.

Parameters:
locale - Locale owning bundle.
Returns:
Bundle for provided locale, closet parent bundle, or null if no bundle (or enclosing bundle) found for locale.
Since:
JDE 3.6

handleGetObject

protected Object handleGetObject(int key)
                          throws MissingResourceException
Retrieves resource object handle by integer key.

This method searches in this bundle for the object; if not found, then it chains back searching enclosing parent bundles for the object.

Overrides:
handleGetObject in class ResourceBundle
Parameters:
key - Integer key associated with resource object.
Returns:
Resource object associated with integer key.
Throws:
MissingResourceException - If the object associated with the key not found.
Since:
JDE 3.6

isEmpty

public boolean isEmpty()
Determines if this bundle family contains no resource bundles.

Returns:
True if this resource bundle family contains no resource bundles.

put

public void put(Locale locale,
                ResourceBundle bundle)
Adds a resource bundle to this bundle family.

Parameters:
locale - Locale for added resource bundle; if the parent locale is not yet present, this method waits for it.
bundle - Resource bundle to add to this fmaily.
Throws:
IllegalStateException - If called from the wrong module.
MissingResourceException - If the parent resource module is not found.
Since:
JDE 3.6


Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.