Android
java.util
public abstract class

java.util.ResourceBundle

java.lang.Object
java.util.ResourceBundle

ResourceBundle is an abstract class which is the superclass of classes which provide locale specific resources. A bundle contains a number of named resources, where the names are Strings. A bundle may have a parent bundle, when a resource is not found in a bundle, the parent bundle is searched for the resource.

Known Direct Subclasses

Summary

Fields

protected      ResourceBundle  parent  The parent of this ResourceBundle. 

Public Constructors

            ResourceBundle()
Constructs a new instance of this class.

Public Methods

      static    ResourceBundle  getBundle(String bundleName, Locale locale, ClassLoader loader)
Finds the named resource bundle for the specified locale.
    final  static    ResourceBundle  getBundle(String bundleName, Locale locale)
Finds the named resource bundle for the specified locale.
    final  static    ResourceBundle  getBundle(String bundleName)
Finds the named resource bundle for the default locale.
abstract          Enumeration<String getKeys()
Returns the names of the resources contained in this ResourceBundle.
          Locale  getLocale()
Gets the Locale of this ResourceBundle.
    final      Object  getObject(String key)
Returns the named resource from this ResourceBundle.
    final      String  getString(String key)
Returns the named resource from this ResourceBundle.
    final      String[]  getStringArray(String key)
Returns the named resource from this ResourceBundle.

Protected Methods

abstract          Object  handleGetObject(String key)
Returns the named resource from this ResourceBundle, or null if the resource is not found.
          void  setParent(ResourceBundle bundle)
Sets the parent resource bundle of this ResourceBundle.
Methods inherited from class java.lang.Object

Details

Fields

protected ResourceBundle parent

The parent of this ResourceBundle.

Public Constructors

public ResourceBundle()

Constructs a new instance of this class.

Public Methods

public static ResourceBundle getBundle(String bundleName, Locale locale, ClassLoader loader)

Finds the named resource bundle for the specified locale.

Parameters

bundleName the name of the resource bundle
locale the locale
loader the ClassLoader to use

Returns

  • ResourceBundle

Throws

MissingResourceException when the resource bundle cannot be found

public static final ResourceBundle getBundle(String bundleName, Locale locale)

Finds the named resource bundle for the specified locale.

Parameters

bundleName the name of the resource bundle
locale the locale

Returns

  • ResourceBundle

Throws

MissingResourceException when the resource bundle cannot be found

public static final ResourceBundle getBundle(String bundleName)

Finds the named resource bundle for the default locale.

Parameters

bundleName the name of the resource bundle

Returns

  • ResourceBundle

Throws

MissingResourceException when the resource bundle cannot be found

public abstract Enumeration<String> getKeys()

Returns the names of the resources contained in this ResourceBundle.

Returns

  • an Enumeration of the resource names

public Locale getLocale()

Gets the Locale of this ResourceBundle.

Returns

  • the Locale of this ResourceBundle

public final Object getObject(String key)

Returns the named resource from this ResourceBundle.

Parameters

key the name of the resource

Returns

  • the resource object

Throws

MissingResourceException when the resource is not found

public final String getString(String key)

Returns the named resource from this ResourceBundle.

Parameters

key the name of the resource

Returns

  • the resource string

Throws

MissingResourceException when the resource is not found

public final String[] getStringArray(String key)

Returns the named resource from this ResourceBundle.

Parameters

key the name of the resource

Returns

  • the resource string array

Throws

MissingResourceException when the resource is not found

Protected Methods

protected abstract Object handleGetObject(String key)

Returns the named resource from this ResourceBundle, or null if the resource is not found.

Parameters

key the name of the resource

Returns

  • the resource object

protected void setParent(ResourceBundle bundle)

Sets the parent resource bundle of this ResourceBundle. The parent is searched for resources which are not found in this resource bundle.

Parameters

bundle the parent resource bundle
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56