img
underscore when linked to the resource bundle name. A resource bundle that has only the
family name is the default bundle. It is used when no language-specific bundles are applicable.
NOTE  The language codes are defined by ISO standard 639 and the country codes by ISO
OTE
standard 3166.
The methods defined by ResourceBundle are summarized in Table 18-17. One important
point: null keys are not allowed and several of the methods will throw a NullPointerException
if null is passed as the key. Notice the nested class ResourceBundle.Control. It was added by
Java SE 6 and is used to control the resource-bundle loading process.
There are two subclasses of ResourceBundle. The first is PropertyResourceBundle, which
manages resources by using property files. PropertyResourceBundle adds no methods of
Method
Description
static final void clearCache( )
Deletes all resource bundles from the cache that were
loaded by the default class loader. (Added by Java SE 6.)
Deletes all resource bundles from the cache that were
static final void
clearCache(ClassLoader ldr)
loaded by ldr. (Added by Java SE 6.)
boolean containsKey(String k)
Returns true if k is a key within the invoking resource
bundle (or its parent). (Added by Java SE 6.)
static final ResourceBundle
Loads the resource bundle with a family name of
getBundle(String familyName)
familyName using the default locale and the default class
loader. Throws MissingResourceException if no resource
bundle matching the family name specified by familyName
is available.
static final ResourceBundle
Loads the resource bundle with a family name of
getBundle(String familyName,
familyName using the specified locale and the default
Locale loc)
class loader. Throws MissingResourceException if no
resource bundle matching the family name specified by
familyName is available.
static ResourceBundle
Loads the resource bundle with a family name of
getBundle(String familyName,
familyName using the specified locale and the specified
Locale loc,
class loader. Throws MissingResourceException if no
ClassLoader ldr)
resource bundle matching the family name specified by
familyName is available.
static final ResourceBundle
Loads the resource bundle with a family name of
getBundle(String familyName,
familyName using the default locale and the default class
ResourceBundle.Control cntl)
loader. The loading process is under the control of cntl.
Throws MissingResourceException if no resource bundle
matching the family name specified by familyName is
available. (Added by Java SE 6.)
Loads the resource bundle with a family name of
static final ResourceBundle
getBundle(String familyName,
familyName using the specified locale and the default
Locale loc,
class loader. The loading process is under the control of
ResourceBundle.Control cntl)
cntl. Throws MissingResourceException if no resource
bundle matching the family name specified by familyName
is available. (Added by Java SE 6.)
TABLE 18-17
The Methods Defined by ResourceBundle
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home