org.jwarp.util
Class ResourceGroup
java.lang.Object
|
+--org.jwarp.util.ResourceGroup
- public class ResourceGroup
- extends java.lang.Object
A class used to manage resource bundles.
|
Field Summary |
protected java.util.HashMap |
bundles
|
protected java.util.Locale |
locale
|
protected static java.util.Random |
RANDOM
|
|
Constructor Summary |
ResourceGroup(java.util.Locale locale)
Create a ResourceGroup to manage resource bundles for a particular locale. |
|
Method Summary |
java.lang.String |
format(java.lang.String base,
java.lang.String key,
java.lang.Object[] args)
Create a new message format given the base resource and the pattern key. |
java.util.ResourceBundle |
getBundle(java.lang.String base)
Get the given Resource bundle. |
java.util.Locale |
getLocale()
Gets the locale |
java.lang.String |
getPattern(java.lang.String base,
java.lang.String key)
Get a pattern with the given key from the base resource. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RANDOM
protected static final java.util.Random RANDOM
bundles
protected final java.util.HashMap bundles
locale
protected final java.util.Locale locale
ResourceGroup
public ResourceGroup(java.util.Locale locale)
- Create a ResourceGroup to manage resource bundles for a particular locale.
- Parameters:
locale - the locale
getLocale
public java.util.Locale getLocale()
- Gets the locale
- Returns:
- The locale
format
public java.lang.String format(java.lang.String base,
java.lang.String key,
java.lang.Object[] args)
- Create a new message format given the base resource and the pattern key. Return the formatted result of the args
- Parameters:
base - The resourcekey - The pattern keyargs - The argument to be formatted- Returns:
- The formatted string
getBundle
public java.util.ResourceBundle getBundle(java.lang.String base)
throws java.util.MissingResourceException
- Get the given Resource bundle.
- Parameters:
base - The resource
getPattern
public java.lang.String getPattern(java.lang.String base,
java.lang.String key)
throws java.util.MissingResourceException
- Get a pattern with the given key from the base resource.
- Parameters:
base - The resourcekey - The pattern key