java.util
public
abstract
class
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
ListResourceBundle |
ListResourceBundle is the abstract superclass of classes which provide
resources by implementing the getContents() method to return
the list of resources. |
PropertyResourceBundle |
PropertyResourceBundle loads resources from an InputStream. |
Summary
Fields
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Fields
The parent of this ResourceBundle.
Public Constructors
public
ResourceBundle()
Constructs a new instance of this class.
Public Methods
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 |
Finds the named resource bundle for the specified locale.
Parameters
bundleName
| the name of the resource bundle |
locale
| the locale |
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 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 |
public
final
String
getString(String key)
Returns the named resource from this ResourceBundle.
Parameters
key
| the name of the resource |
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
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 |
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
|