sears.tools
Class SearsResourceBundle

java.lang.Object
  extended by sears.tools.SearsResourceBundle

public class SearsResourceBundle
extends java.lang.Object

Class SearsResourceBundle.
Summary:
This class permits to access to the string resources in the choosen locale.


Constructor Summary
SearsResourceBundle()
          Constructor SearsResourceBundle.
SearsResourceBundle(java.util.Locale locale)
          Constructor SearsResourceBundle.
 
Method Summary
static java.util.Locale getLocale()
          Method getLocale.
static java.lang.String getResource(java.lang.String key)
          Method getResource.
static java.lang.String getResource(java.lang.String key, java.lang.String defaultValue)
          Method getResource.
static void setLocale(java.util.Locale locale)
          Method setLocale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearsResourceBundle

public SearsResourceBundle()
Constructor SearsResourceBundle.
Summary:
Constructor of the class.


SearsResourceBundle

public SearsResourceBundle(java.util.Locale locale)
Constructor SearsResourceBundle.
Summary:
Constructor of the class.

Method Detail

setLocale

public static void setLocale(java.util.Locale locale)
Method setLocale.
Summary:
Change the locale to the specified one.

Parameters:
locale - The new locale to set.

getResource

public static java.lang.String getResource(java.lang.String key)
Method getResource.
Summary:
This method permits to return a resources associated to the given key in the resource bundle. It returns "", if key is not found in resource bundle.

Parameters:
key - The key of the value to found.
Returns:
String The resources associated to the given key in the resource bundle.

getResource

public static java.lang.String getResource(java.lang.String key,
                                           java.lang.String defaultValue)
Method getResource.
Summary:
This method permits to return a resources associated to the given key in the resource bundle. It returns the default value, if key is not found in resource bundle.

Parameters:
key - The key of the value to found.
defaultValue - The default value to return, if key is not found.
Returns:
String The resources associated to the given key in the resource bundle.

getLocale

public static java.util.Locale getLocale()
Method getLocale.
Summary:
Return the Locale.

Returns:
Locale The Locale.