net.rim.device.api.i18n
Class ResourceBundleFamily

java.lang.Object
  extended by net.rim.device.api.i18n.ResourceBundle
      extended by 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.
 long getId()
          Retrieves this bundle family's ID.
 String getName()
          Retrieves this bundle family's name.
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.
 boolean verify(CodeSigningKey key)
          Determines if all resource bundles in this family are signed with provided key.
 
Methods inherited from class net.rim.device.api.i18n.ResourceBundle
getBundle, 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.

getId

public long getId()
Retrieves this bundle family's ID.

Returns:
ID for this bundle family.
Since:
BlackBerry API 4.0.0

getName

public String getName()
Retrieves this bundle family's name.

Returns:
Name for this bundle family.
Since:
BlackBerry API 4.0.0

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.

Specified by:
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.

isEmpty

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

Returns:
True if this resource bundle family contains no resource bundles; otherwise, false.

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 family.
Throws:
IllegalStateException - If called from the wrong module.
MissingResourceException - If the parent resource module is not found.

verify

public boolean verify(CodeSigningKey key)
Determines if all resource bundles in this family are signed with provided key.

Parameters:
key - Code signing key to test against. If null, then this method always returns true.
Returns:
True if all bundles in this family are signed with provided key; otherwise, false.
Since:
BlackBerry API 4.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal