|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.chwf.i18n.Message
A class for encapsulating an internationalizable message. It is
designed to defer computation of the message, to handle the situation
when the precise locale is not available at the time when the message
is generated. All the information necessary to generate the message is
stored in the Message
object. It can be printed out using
the message's toString()
method when the message reaches
a point where it is possible to determine the locale.
Every message has a context class. This class will typically be the class that created the message. The context class is used to determine which configuration file should be used to load internationalized messages from.
When the message is rendered, the precise locale is determined using
UserLocale.getLocale()
.
Field Summary | |
static java.lang.Object[] |
NO_ARGUMENTS
An empty array for constructing messages with no arguments. |
Method Summary | |
static Message |
getMessage(java.lang.String key,
java.lang.Object[] arguments,
java.lang.Class context)
Create a message object. |
static Message |
getMessage(java.lang.String key,
java.lang.Object[] arguments,
java.lang.String context)
Create a message object. |
java.lang.String |
toString()
Returns the formatted message using the user's locale. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.Object[] NO_ARGUMENTS
Method Detail |
public static Message getMessage(java.lang.String key, java.lang.Object[] arguments, java.lang.Class context)
key
- The message key. If the key lookup fails, the key is used
as the pattern instead.arguments
- The arguments for the pattern.context
- The context class.public static Message getMessage(java.lang.String key, java.lang.Object[] arguments, java.lang.String context)
key
- The message key. If the key lookup fails, the key is used
as the pattern instead.arguments
- The arguments for the pattern.context
- The context resource.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |