com.cafesoft.core.util
Class ResourceBundleUtils

java.lang.Object
  |
  +--com.cafesoft.core.util.ResourceBundleUtils

public class ResourceBundleUtils
extends Object

ResourceBundleUtils provides utilities for working with java.util.ResourceBundle objects. This class maintains a static Map of ResourceBundle instances by name. The Map of ResourceBundles is lazilly loaded by use of static method:

 public static ResourceBundleUtils getResourceBundleUtils(String type)
 
where 'type' corresponds to a category of resources.

Resources are loaded from a Java Properties file within the current classpath. For example, if type="server", then a file named: 'server.properties' must exist within the current classpath (in the default package location).

Since:
7/15/02
See Also:
ResourceBundle

Method Summary
static ResourceBundleUtils getResourceBundleUtils(String type)
          Returns the ResourceBundle which is mapped to the specified name.
 String getString(String key)
          Returns the String that is mapped to the specified key.
 String getString(String key, Object arg)
          Returns the String that is mapped to the specified key.
 String getString(String key, Object[] args)
          Returns the String that is mapped to the specified key.
 String getString(String key, Object arg1, Object arg2)
          Returns the String that is mapped to the specified key.
 String getString(String key, Object arg1, Object arg2, Object arg3)
          Returns the String that is mapped to the specified key.
 String getString(String key, Object arg1, Object arg2, Object arg3, Object arg4)
          Returns the String that is mapped to the specified key.
 String getString(String key, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
          Returns the String that is mapped to the specified key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getResourceBundleUtils

public static ResourceBundleUtils getResourceBundleUtils(String type)
Returns the ResourceBundle which is mapped to the specified name.

Parameters:
type - the name of the requested resource bundle
Returns:
the resource bundle mapped to the specified name

getString

public String getString(String key)
Returns the String that is mapped to the specified key.

Parameters:
key - the resource bundle string key.
Returns:
the String value that matches the key or the value "NULL KEY" if if key is null.

getString

public String getString(String key,
                        Object arg)
Returns the String that is mapped to the specified key.

Parameters:
key - a unique value
arg - first argument
Returns:
the formated String that matches the key

getString

public String getString(String key,
                        Object arg1,
                        Object arg2)
Returns the String that is mapped to the specified key.

Parameters:
key - a unique value
arg1 - first argument
arg2 - second argument
Returns:
the formated String that matches the key

getString

public String getString(String key,
                        Object arg1,
                        Object arg2,
                        Object arg3)
Returns the String that is mapped to the specified key.

Parameters:
key - a unique value
arg1 - first argument
arg2 - second argument
arg3 - third argument
Returns:
the formated String that matches the key

getString

public String getString(String key,
                        Object arg1,
                        Object arg2,
                        Object arg3,
                        Object arg4)
Returns the String that is mapped to the specified key.

Parameters:
key - a unique value
arg1 - first argument
arg2 - second argument
arg3 - third argument
arg4 - fourth argument
Returns:
the formated String that matches the key

getString

public String getString(String key,
                        Object arg1,
                        Object arg2,
                        Object arg3,
                        Object arg4,
                        Object arg5)
Returns the String that is mapped to the specified key.

Parameters:
key - a unique value
arg1 - first argument
arg2 - second argument
arg3 - third argument
arg4 - fourth argument
arg5 - fifth argument
Returns:
the formated String that matches the key

getString

public String getString(String key,
                        Object[] args)
Returns the String that is mapped to the specified key. The specified arguments are substituted into the string.

Parameters:
key - a unique value
args - used for formatting the string
Returns:
the formatted string


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.