Resource Bundles Flashcards
Returns the value mapped to the given key. Throws a MissingResourceException if no object for a given key is found.
Object getObject(String key)
Returns the ResourceBundle for the given baseName, locale, and control; throws a MissingResourceException if no matching resource bundle is found. The Control instance is meant for controlling or obtaining info about the resource bundle loading process.
static ResourceBundle getBundle(String baseName)
static final ResourceBundle getBundle(String baseName, Locale locale)
final ResourceBundle getBundle(String baseName, Locale targetLocale, Control control)
Returns the value mapped to a given key; equivalent to casting the return value from getObject() to String. Throws a MissingResourceException if no object for a given key is found. Throws ClassCastException if the object returned is not a string.
String getString(String key)
This concrete class provides support for multiple locales in the form of property files. For each locale, if you use the ResourceBundle.getBundle() method, the relevant property file will be loaded if the proper naming conventions for the property files are followed.
PropertyResourceBundle
This abstract class provides support for locales within the program itself without using property files. Extend this class and override the getContents() method to return an Object array containing the locale data.
ListResourceBundle
Load the resource bundle.
ResourceBundle.getBundle(String bundleName, Locale locale)