|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.globalization.GlobalizedMessage
Represents a key into a ResourceBundle, a target ResourceBundle, and possibly an array of arguments to interpolate into the retrieved message using the MessageFormat class.
This class should be used in any situation where the application needs to output localizeable objects.
MessageFormat
,
Locale
,
ResourceBundle
Field Summary | |
static String |
versionId
|
Constructor Summary | |
GlobalizedMessage(String key)
Constructor. |
|
GlobalizedMessage(String key,
Object[] args)
Constructor. |
|
GlobalizedMessage(String key,
String bundleName)
Constructor. |
|
GlobalizedMessage(String key,
String bundleName,
Object[] args)
Constructor. |
Method Summary | |
String |
getKey()
Get the key for this GlobalizedMessage. |
Object |
localize()
Localize this message. |
Object |
localize(javax.servlet.http.HttpServletRequest request)
Localize this message according the specified request. |
Object |
localize(Locale locale)
Localize this message with the provided locale. |
String |
toString()
For debugging, not for localizing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public GlobalizedMessage(String key)
Constructor. Takes in a key to be used to look up a message in the ResourceBundle for the current running application. The base name of the ResourceBundle to do the lookup in is retrieved from the ApplicationContext.
key
- The key to use to look up a message in the ResourceBundle.public GlobalizedMessage(String key, String bundleName)
Constructor. Takes in a key to be used to look up a message in the ResourceBundle specified.
key
- The key to use to look up a message in the ResourceBundle.bundleName
- The base name of the target ResourceBundle.public GlobalizedMessage(String key, Object[] args)
Constructor. Takes in a key to be used to look up a message in the ResourceBundle for the current running application. The base name of the ResourceBundle to do the lookup in is retrieved from the ApplicationContext. Also takes in an Object[] of arguments to interpolate into the retrieved message using the MessageFormat class.
key
- The key to use to look up a message in the ResourceBundle.args
- An Object[] of arguments to interpolate into the retrieved
message.public GlobalizedMessage(String key, String bundleName, Object[] args)
Constructor. Takes in a key to be used to look up a message in the ResourceBundle specified. Also takes in an Object[] of arguments to interpolate into the retrieved message using the MessageFormat class.
key
- The key to use to look up a message in the ResourceBundle.bundleName
- The base name of the target ResourceBundle.args
- An Object[] of arguments to interpolate into the retrieved
message.Method Detail |
public final String getKey()
Get the key for this GlobalizedMessage.
public Object localize()
Localize this message. If no message is found the key is returned as
the message. This is done so that developers or translators can see the
messages that still need localization.
Any arguments this message has are interpolated into it using the java.text.MessageFormat class.
public Object localize(javax.servlet.http.HttpServletRequest request)
Localize this message according the specified request. If no message is
found the key is returned as the message. This is done so that
developers or translators can see the messages that still need
localization.
Any arguments this message has are interpolated into it using the java.text.MessageFormat class.
public Object localize(Locale locale)
Localize this message with the provided locale. If no message is found the key is returned as the message. This is done so that developers or translators can see the messages that still need localization.
Any arguments this message has are interpolated into it using the java.text.MessageFormat class.
locale
- The locale to try to use to localize this message.
public String toString()
For debugging, not for localizing.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |