| java.lang.Object org.tanukisoftware.wrapper.resources.ResourceManager
ResourceManager | public class ResourceManager (Code) | | Some helper functions for handling i18n issues. One instance of this class
should be created for each resource.
The ResourceManager is created by a call to getResourceManager() .
The (optional) parameter is the name of the desired resource, not including the
.properties suffix.
For example,
ResourceManager res = getResourceBundle();
to get the default resources, or
ResourceManager res = getResourceBundle("sql");
to load the resources in sql.properties .
To use the ResourceManager make a call to any of the format()
methods. If a string is not found in the bundle the key is returned and a
message is logged to the debug channel for this class.
author: Leif Mortenson |
Method Summary | |
public String | format(String key) | public String | format(String pattern, Object o0) Returns a string that has been obtained from the resource manager then
formatted using the passed parameters. | public String | format(String pattern, Object o0, Object o1) Returns a string that has been obtained from the resource manager then
formatted using the passed parameters. | public String | format(String pattern, Object o0, Object o1, Object o2) Returns a string that has been obtained from the resource manager then
formatted using the passed parameters. | public String | format(String pattern, Object o0, Object o1, Object o2, Object o3) Returns a string that has been obtained from the resource manager then
formatted using the passed parameters. | public static ResourceManager | getResourceManager() Returns the default resource manager. | public static synchronized ResourceManager | getResourceManager(String resourceName) Returns the named resource manager. | public static synchronized void | refresh() Clears the resource manager's cache of bundles (this should be called
if the default locale for the application changes). |
format | public String format(String key)(Code) | | Returns a string that has been obtained from the resource manager
Parameters: key - The string that is the key to the translated message |
format | public String format(String pattern, Object o0)(Code) | | Returns a string that has been obtained from the resource manager then
formatted using the passed parameters.
Parameters: pattern - The string that is the key to the translated message Parameters: o0 - The param passed to format replaces {0} |
format | public String format(String pattern, Object o0, Object o1)(Code) | | Returns a string that has been obtained from the resource manager then
formatted using the passed parameters.
Parameters: pattern - The string that is the key to the translated message Parameters: o0 - The param passed to format replaces {0} Parameters: o1 - The param passed to format replaces {1} |
format | public String format(String pattern, Object o0, Object o1, Object o2)(Code) | | Returns a string that has been obtained from the resource manager then
formatted using the passed parameters.
Parameters: pattern - The string that is the key to the translated message Parameters: o0 - The param passed to format replaces {0} Parameters: o1 - The param passed to format replaces {1} Parameters: o2 - The param passed to format replaces {2} |
format | public String format(String pattern, Object o0, Object o1, Object o2, Object o3)(Code) | | Returns a string that has been obtained from the resource manager then
formatted using the passed parameters.
Parameters: pattern - The string that is the key to the translated message Parameters: o0 - The param passed to format replaces {0} Parameters: o1 - The param passed to format replaces {1} Parameters: o2 - The param passed to format replaces {2} Parameters: o3 - The param passed to format replaces {3} |
getResourceManager | public static ResourceManager getResourceManager()(Code) | | Returns the default resource manager.
An instance of the ResourceManager class is created the first
time the method is called.
|
getResourceManager | public static synchronized ResourceManager getResourceManager(String resourceName)(Code) | | Returns the named resource manager.
An instance of the ResourceManager class is created the first
time the method is called.
Parameters: resourceName - The name of the desired resource |
refresh | public static synchronized void refresh()(Code) | | Clears the resource manager's cache of bundles (this should be called
if the default locale for the application changes).
|
|
|