|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.retek.commons.gui.util.TranslatorManager
com.retek.commons.gui.util.MessageTranslator
This class encapsulates a RPropertyBundle object and defines the KEY-VALUE pair as being a message code and fully translated message text. The message text in the properties file may contain {0} {1} {2} as placeholders for dynamic argument placing. The class supplies easy methods for accessing these underlying messages to retrieve internationalized messages.
Retek Inc. Copyright (c) 2002
Field Summary |
---|
Fields inherited from class com.retek.commons.gui.util.TranslatorManager |
---|
EMPTY |
Constructor Summary | |
---|---|
MessageTranslator()
Returns new MessageManager object. |
|
MessageTranslator(java.util.Locale locale,
java.lang.String filename)
Returns new MessageManager object. |
|
MessageTranslator(java.lang.String filename)
Returns new MessageManager object. |
Method Summary | |
---|---|
java.lang.String |
getMessage(java.lang.Exception exception)
Retrieves the expanded message translation for an generic exception message. |
java.lang.String |
getMessage(java.lang.String messageCode)
Retrieves the expanded message translation for the specific message code. |
java.lang.String |
getMessage(java.lang.String messageCode,
java.lang.String valueOne)
Retrieves the expanded message translation for a specific message code. |
java.lang.String |
getMessage(java.lang.String messageCode,
java.lang.String[] valueArray)
Retrieves the expanded message translation for the specific message code. |
java.lang.String |
getMessage(java.lang.String messageCode,
java.lang.String valueOne,
java.lang.String valueTwo)
Retrieves the expanded message translation for a specific message code. |
java.lang.String |
getMessage(UiBusinessException exception)
Retrieves the full message translation for a UiBusinessException message/error code. |
Methods inherited from class com.retek.commons.gui.util.TranslatorManager |
---|
getBundle, getLocale, setBundle, setLocale, setLocale |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MessageTranslator()
public MessageTranslator(java.lang.String filename) throws UiBundleException
filename
- The filename of the properties file to load.
UiBundleException
- Thrown if the method fails to load the properties file.public MessageTranslator(java.util.Locale locale, java.lang.String filename) throws UiBundleException
locale
- The Locale to load the message translation for.filename
- The filename of the properties file to load.
UiBundleException
- Thrown if the method fails to load the properties file.Method Detail |
public java.lang.String getMessage(UiBusinessException exception)
exception
- A UiBusinessException to retrieve a translated message from.
public java.lang.String getMessage(java.lang.Exception exception)
exception
- An Exception object to attempt to translate.
public java.lang.String getMessage(java.lang.String messageCode)
messageCode
- The message code to retrieve a message for.
public java.lang.String getMessage(java.lang.String messageCode, java.lang.String valueOne)
messageCode
- The message code to retrieve the message for.valueOne
- A string value to replace a placeholder in the message text.
public java.lang.String getMessage(java.lang.String messageCode, java.lang.String valueOne, java.lang.String valueTwo)
messageCode
- The message code to retrieve the message for.valueOne
- A string value to replace a placeholder in the message text.valueTwo
- A string value to replace a placeholder in the message text.
public java.lang.String getMessage(java.lang.String messageCode, java.lang.String[] valueArray)
messageCode
- The message code to retrieve the message for.valueArray
- An array of strings to replace placeholders in the message text.
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |