|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.util.ResourceBundle
|
+--com.ice.util.FormatResourceBundle
| Field Summary |
| Fields inherited from class java.util.ResourceBundle |
parent |
| Constructor Summary | |
FormatResourceBundle(java.util.ResourceBundle bundle)
Construct a new FormatResourceBundle by encapsulating another ResourceBundle object which is the actual bundle. |
|
| Method Summary | |
static void |
addAlias(java.lang.String alias,
java.lang.String baseName)
Add a resource name alias. |
static FormatResourceBundle |
getFormatBundle(java.lang.String baseName)
Get a FormatResourceBundle. |
static FormatResourceBundle |
getFormatBundle(java.lang.String baseName,
java.util.Locale locale)
Get a FormatResourceBundle. |
java.lang.String |
getFormatString(java.lang.String key,
java.lang.Object[] args)
Get a string from the resource bundle, and return the formatted version of the string using args. |
java.util.Enumeration |
getKeys()
Return an enumeration of the resource keys. |
java.lang.String |
getString(java.lang.String key,
java.lang.String defValue)
This method simply extends the ResourceBundle's getString() with a method that allows a default value to be specified. |
protected java.lang.Object |
handleGetObject(java.lang.String key)
Return an object identified by its key. |
static void |
unCache(java.lang.String alias,
java.lang.String baseName)
This class method allows you to remove a bundle from the cache. |
| Methods inherited from class java.util.ResourceBundle |
getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, setParent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FormatResourceBundle(java.util.ResourceBundle bundle)
bundle - The resource bundle that we are encapsulating.| Method Detail |
public static void addAlias(java.lang.String alias,
java.lang.String baseName)
FormatResourceBundle.addAlias( "ui", "com.ice.mail.resources.ui" );
...
FormatResourceBundle fmtBndl =
FormatResourceBundle.getFormatBundle( "ui" );
...
FormatResourceBundle.getFormatBundle( "ui" ).getString( "menuName" );
The alias will only work with the getFormatBundle() class methods
in this class, and will not work with the other ResourceBundle
getBundle() class methods.
alias - The alias by which you will refer to this resource bundle.baseName - The actual resource name used to get the bundle.
public static void unCache(java.lang.String alias,
java.lang.String baseName)
baseName - The resource bundle's name or alias.public static FormatResourceBundle getFormatBundle(java.lang.String baseName)
baseName - The name, or alias, of the bundle to get.
public static FormatResourceBundle getFormatBundle(java.lang.String baseName,
java.util.Locale locale)
baseName - The name, or alias, of the bundle to get.locale - The locale to use in locating the bundle.
public java.lang.String getString(java.lang.String key,
java.lang.String defValue)
key - The key of the string resource to format.defValue - The default value used if key not found.
public java.lang.String getFormatString(java.lang.String key,
java.lang.Object[] args)
key - The key of the string resource to format.args - The arguments to use to format the string.
public java.util.Enumeration getKeys()
getKeys in class java.util.ResourceBundleprotected java.lang.Object handleGetObject(java.lang.String key)
handleGetObject in class java.util.ResourceBundlekey - The key of the object to return.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||