ResourceBundle class Methods in Java

 java.util.ResourceBundle

Resource bundles contain locale-specific objects. When your program needs a locale-specific resource, a String for example, your program can load it from the resource bundle that is appropriate for the current user's locale.

Some methods of  ResourceBundle class.


containsKey(String)This method determines whether the given key is contained in this ResourceBundle or its parent bundles.


clearCache()This method removes all resource bundles from the cache that have been loaded by the caller's module.


clearCache(ClassLoader)This method removes all resource bundles from the cache that have been loaded by the given class loader.


equals(Object)This method indicates whether some other object is "equal to" this one.


getBaseBundleName()This method returns the base name of this bundle, if known, or null if unknown.


ResourceBundle.getBundle(String)This method gets a resource bundle using the specified base name, the default locale, and the caller module.


ResourceBundle.getBundle(String, Control)This method returns a resource bundle using the specified base name, the default locale, and the specified control.


ResourceBundle.getBundle(String, Locale)This method gets a resource bundle using the specified base name and locale, and the caller module.


ResourceBundle.getBundle(String, Locale, ClassLoader)This method gets a resource bundle using the specified base name, locale, and classloader.


ResourceBundle.getBundle(String, Locale, Control)This method returns a resource bundle using the specified base name, targetlocale and control, and the caller's class loader.


ResourceBundle.getBundle(String, Locale, ClassLoader, Control)This method returns a resource bundle using the specified base name, targetlocale, classloader, and control.


getKeys()This method returns an enumeration of the keys.


getLocale()This method returns the locale of this resource bundle.


getObject(String)This method gets an object for the given key from this resource bundle or one of its parents.


getString(String)This method gets a string for the given key from this resource bundle or one of its parents.


hashCode()This method returns a hash code value for the object.


keySet()This method returns a Set of all keys contained in this ResourceBundle and its parent bundles.


toString()This method returns a string representation of the object.



No comments:

Post a Comment