|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tanukisoftware.wrapper.resources.ResourceManager
public class ResourceManager
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.
Method Summary | |
---|---|
java.lang.String |
format(java.lang.String key)
Returns a string that has been obtained from the resource manager |
java.lang.String |
format(java.lang.String pattern,
java.lang.Object o0)
Returns a string that has been obtained from the resource manager then formatted using the passed parameters. |
java.lang.String |
format(java.lang.String pattern,
java.lang.Object o0,
java.lang.Object o1)
Returns a string that has been obtained from the resource manager then formatted using the passed parameters. |
java.lang.String |
format(java.lang.String pattern,
java.lang.Object o0,
java.lang.Object o1,
java.lang.Object o2)
Returns a string that has been obtained from the resource manager then formatted using the passed parameters. |
java.lang.String |
format(java.lang.String pattern,
java.lang.Object o0,
java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3)
Returns a string that has been obtained from the resource manager then formatted using the passed parameters. |
static ResourceManager |
getResourceManager()
Returns the default resource manager. |
static ResourceManager |
getResourceManager(java.lang.String resourceName)
Returns the named resource manager. |
static void |
refresh()
Clears the resource manager's cache of bundles (this should be called if the default locale for the application changes). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ResourceManager getResourceManager()
public static ResourceManager getResourceManager(java.lang.String resourceName)
resourceName
- The name of the desired resourcepublic static void refresh()
public java.lang.String format(java.lang.String key)
key
- The string that is the key to the translated messagepublic java.lang.String format(java.lang.String pattern, java.lang.Object o0)
pattern
- The string that is the key to the translated messageo0
- The param passed to format replaces {0}public java.lang.String format(java.lang.String pattern, java.lang.Object o0, java.lang.Object o1)
pattern
- The string that is the key to the translated messageo0
- The param passed to format replaces {0}o1
- The param passed to format replaces {1}public java.lang.String format(java.lang.String pattern, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2)
pattern
- The string that is the key to the translated messageo0
- The param passed to format replaces {0}o1
- The param passed to format replaces {1}o2
- The param passed to format replaces {2}public java.lang.String format(java.lang.String pattern, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
pattern
- The string that is the key to the translated messageo0
- The param passed to format replaces {0}o1
- The param passed to format replaces {1}o2
- The param passed to format replaces {2}o3
- The param passed to format replaces {3}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |