|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.beasys.commerce.i18n.MessageBundle
MessageBundle provides methods which facilitate the internationalization
of applications through retrieval of locale-specific static text and
constructed messages. Constructed messages are created when message
arguments are passed into the getString()
or
getMessage()
methods.
Field Summary | |
protected static boolean |
debug
|
protected java.util.ResourceBundle |
resourceBundle
|
Constructor Summary | |
protected |
MessageBundle()
|
Method Summary | |
protected static void |
debug(java.lang.String aMessage)
Convenience method for logging a LOG_DEBUG level message |
protected static void |
error(java.lang.String aMessage,
java.lang.Exception exception)
Convenience method for logging a LOG_ERROR level message |
static MessageBundle |
getBundle(java.lang.String baseName)
Retrieves an instance of a MessageBundle , provided a
base name from which the bundle can be constructed. |
static MessageBundle |
getBundle(java.lang.String baseName,
java.util.Locale locale)
Get the appropriate ResourceBundle subclass. |
static MessageBundle |
getBundle(java.lang.String baseName,
java.util.Locale locale,
java.lang.ClassLoader loader)
Get the appropriate ResourceBundle subclass. |
static MessageBundle |
getInstance(java.lang.String baseName)
Deprecated. Replaced by getBundle(String) |
java.util.Enumeration |
getKeys()
Return an enumeration of the keys. |
java.util.Locale |
getLocale()
Return the Locale for this MessageBundle. |
java.lang.String |
getMessage(java.lang.Object[] args,
java.lang.String key)
Constructs a message using the provided arguments and a key into the message bundle's properties table. |
java.lang.Object |
getObject(java.lang.String key)
Get an object from a ResourceBundle. |
java.lang.String |
getString(java.lang.String key)
Retrieves a static text segment using a key into the message bundle's properties table. |
java.lang.String[] |
getStringArray(java.lang.String key)
Get an object from a ResourceBundle. |
protected static void |
info(java.lang.String aMessage)
Convenience method for logging a LOG_INFO level message |
protected static void |
warning(java.lang.String aMessage)
Convenience method for logging a LOG_WARNING level message |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected static final boolean debug
protected java.util.ResourceBundle resourceBundle
Constructor Detail |
protected MessageBundle()
Method Detail |
public static MessageBundle getInstance(java.lang.String baseName)
getBundle(String)
public java.lang.String getMessage(java.lang.Object[] args, java.lang.String key)
args
- the arguments used to construct the message.
For example, {"Wednesday", "78"};key
- the key into the MessageBundle
object's
properties
For example, "dayAndTemp.msg"String
the resultant message
For example, "Today is Wednesday, and the
temperature is 78 degrees."public java.lang.String getString(java.lang.String key)
key
- the key into the MessageBundle
object's
properties
For example, "hello.txt"String
the static text segment
For example, "Hello."public static MessageBundle getBundle(java.lang.String baseName)
MessageBundle
, provided a
base name from which the bundle can be constructed.baseName
- the class name used to retrieve the bundle.
An example of a base name is
"com.beasys.commerce.portal.jspbeans.i18n.GenPrefs",
where a text file titled
"GenPrefs.properties" exists in the "i18n"
directory under the
"com.beasys.commerce.portal.jspbeans" package.MessageBundle
public static MessageBundle getBundle(java.lang.String baseName, java.util.Locale locale)
baseName
- the class name used to retrieve the bundle.
An example of a base name is
"com.beasys.commerce.portal.jspbeans.i18n.GenPrefs",
where a text file titled
"GenPrefs.properties" exists in the "i18n"
directory under the
"com.beasys.commerce.portal.jspbeans" package.locale
- the locale of preference for the resource bundlepublic static MessageBundle getBundle(java.lang.String baseName, java.util.Locale locale, java.lang.ClassLoader loader)
baseName
- the class name used to retrieve the bundle.
An example of a base name is
"com.beasys.commerce.portal.jspbeans.i18n.GenPrefs",
where a text file titled
"GenPrefs.properties" exists in the "i18n"
directory under the
"com.beasys.commerce.portal.jspbeans" package.locale
- the locale of preference for the resource bundleloader
- the class loader to use when trying to load the resourcepublic java.util.Enumeration getKeys()
public java.util.Locale getLocale()
public java.lang.Object getObject(java.lang.String key)
public java.lang.String[] getStringArray(java.lang.String key)
protected static void debug(java.lang.String aMessage)
protected static void info(java.lang.String aMessage)
protected static void warning(java.lang.String aMessage)
protected static void error(java.lang.String aMessage, java.lang.Exception exception)
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |