com.sas.servlet.beans.html
Class RB
java.lang.Object
|
+--com.sas.util.RBBase
|
+--com.sas.servlet.beans.html.RB
- public final class RB
- extends RBBase
RB loads and manages the resource bundle for the com.sas.servlet.beans.html package.
RB has convenience methods which allow other classes to fetch a string resource
from the package resource bundle, which is created as
a PropertyResourceBundle from com.sas.servlet.beans.html.Resources, which is defined
in the properties file, Resources.properties (or in a locale-specific
version such as Resources_de_DE.properties etc.)
Method Summary |
static ResourceBundle |
getResources()
Get the default resource bundle for this package, which is created as
a PropertyResourceBundle from
com.sas.servlet.beans.html.Resources , which is defined
in the properties file, <package-path>/Resources.properties
(or in a locale-specific version such as Resources_de_DE.properties etc.) |
static String |
getStringResource(String key)
Return a string resource from the default resource bundle. |
static String |
getStringResource(String classKey,
String subKey)
Return a string resource from the default resource bundle via
getStringResource(classKey + subKey). |
Methods inherited from class com.sas.util.RBBase |
_getResources,
_getStringResource,
getResourceAsBoolean,
getResourceAsBoolean,
getResourceAsByte,
getResourceAsByte,
getResourceAsChar,
getResourceAsChar,
getResourceAsDouble,
getResourceAsDouble,
getResourceAsFloat,
getResourceAsFloat,
getResourceAsInt,
getResourceAsInt,
getResourceAsLong,
getResourceAsLong,
getResourceAsObject,
getResourceAsObject,
getResourceAsObject,
getResourceAsObject,
getResourceAsShort,
getResourceAsShort |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
RB
public RB()
getStringResource
public static String getStringResource(String classKey,
String subKey)
- Return a string resource from the default resource bundle via
getStringResource(classKey + subKey).
- Parameters:
classKey
- a prefix for a resource key, often the class base name
with a trailing ".". For example, the com.sas.util.Alarm class will use
the class key "Alarm."subKey
- a resource key. The classKey and subKey are concatenated
(classKey + subkey) to yield a key and then a resource is fetched
from the resource bundle.- Returns:
- String a string resource obtained via the key.
- Throws:
- MissingResourceException - if there is no resource
for the string (classKey + subKey)
getStringResource
public static String getStringResource(String key)
- Return a string resource from the default resource bundle.
- Parameters:
key
- a resource key- Returns:
- String a string resource obtained from the key, namely
getResources().getString(key)
- Throws:
- MissingResourceException - if there is no resource
for the key.
getResources
public static ResourceBundle getResources()
- Get the default resource bundle for this package, which is created as
a
PropertyResourceBundle
from
com.sas.servlet.beans.html.Resources
, which is defined
in the properties file, <package-path>/Resources.properties
(or in a locale-specific version such as Resources_de_DE.properties
etc.)
- Returns:
- the default resource bundle.
Version: 1.2.20000317.001 Formatted: 2000/07/06 15:57:33PM