|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sas.edir.util.RBBase
This class is used to manage locale specific strings.
Every package should contain a class, RB, that extends this class and a resource bundle, Resources.properties.
| Field Summary | |
protected static java.lang.String |
CORRUPT_MSG_FILE
|
protected static java.lang.String |
MISSING_MSG_FILE
|
| Constructor Summary | |
protected |
RBBase()
Protected constructor because RB is accessed through static methods. |
| Method Summary | |
static java.lang.String |
formatString(RBBase rb,
java.util.Locale locale,
java.lang.String key,
java.lang.Object[] args)
Returns a formatted string resource from the default resource bundle. |
protected java.lang.String |
getBundleName()
Returns the resource bundle name for this object. |
protected java.lang.String |
getfileName()
Returns the filename for this object. |
protected java.util.ResourceBundle |
getResourceBundle(java.util.Locale locale)
Returns the resource bundle for this object. |
static java.util.ResourceBundle |
getResources(RBBase rb,
java.util.Locale locale)
Returns the default resource bundle for this package. |
static java.lang.String |
getString(RBBase rb,
java.util.Locale locale,
java.lang.String key)
Returns a string resource from the default resource bundle. |
protected void |
setResourceBundle(java.util.Locale locale,
java.util.ResourceBundle bundle)
Sets the resource bundle for this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final java.lang.String MISSING_MSG_FILE
protected static final java.lang.String CORRUPT_MSG_FILE
| Constructor Detail |
protected RBBase()
| Method Detail |
public static java.lang.String getString(RBBase rb,
java.util.Locale locale,
java.lang.String key)
rb - The resource bundle to fetch the resource from.locale - The locale to use.key - A resource key.
public static java.lang.String formatString(RBBase rb,
java.util.Locale locale,
java.lang.String key,
java.lang.Object[] args)
The string resource is formatted by MessageFormat.format using
args as the format arguments.
rb - The resource bundle to fetch the resource from.locale - The locale to use.key - A resource key.args - Arguments used to format the string stored in key.
public static java.util.ResourceBundle getResources(RBBase rb,
java.util.Locale locale)
The bundle is created as a PropertyResourceBundle from package.Resources, which is defined in the properties file, package.Resources.properties (or in a locale-specific version such as Resources_de_DE.properties).
rb - The resource bundle to fetch the resource from.locale - The locale to use.protected java.util.ResourceBundle getResourceBundle(java.util.Locale locale)
locale - The locale to use.
protected void setResourceBundle(java.util.Locale locale,
java.util.ResourceBundle bundle)
locale - The locale to use.The - new resource bundle for this object.protected java.lang.String getBundleName()
protected java.lang.String getfileName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||