com.sap.tc.mobile.logging
Class MsgLocalization

java.lang.Object
  extended by com.sap.tc.mobile.logging.MsgLocalization

public abstract class MsgLocalization
extends java.lang.Object

Message object localization class. This class provides a service to localize localizable messages.

Author:
d039184

Constructor Summary
MsgLocalization()
           
 
Method Summary
static java.lang.String getLocalizedText(MsgObject mo)
          Get localized text for message object in default locale.
static java.lang.String getLocalizedText(MsgObject mo, java.lang.Object[] args)
          Get localized text for message object and format message in default locale.
static java.lang.String getLocalizedText(MsgObject mo, java.lang.Object[] args, java.lang.String language)
          Get localized text for message object and format message in specific locale.
static java.lang.String getLocalizedText(MsgObject mo, java.lang.String language)
          Get localized text for message object in specific locale.
protected abstract  java.lang.String localize(java.lang.String locale, java.lang.String key, java.lang.Class msgClass, java.lang.String defaultText)
          Internal method: Localize message text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MsgLocalization

public MsgLocalization()
Method Detail

localize

protected abstract java.lang.String localize(java.lang.String locale,
                                             java.lang.String key,
                                             java.lang.Class msgClass,
                                             java.lang.String defaultText)
Internal method: Localize message text.

Parameters:
locale - locale (language).
key - key of the message to localize.
defaultText - default text of the message.
msgClass - message class.

getLocalizedText

public static java.lang.String getLocalizedText(MsgObject mo)
Get localized text for message object in default locale.

Parameters:
mo - message object to localize.
Returns:
localized message.

getLocalizedText

public static java.lang.String getLocalizedText(MsgObject mo,
                                                java.lang.String language)
Get localized text for message object in specific locale.

Parameters:
language - 2-letter ISO language code.
mo - message object to localize.
Returns:
localized message.

getLocalizedText

public static java.lang.String getLocalizedText(MsgObject mo,
                                                java.lang.Object[] args)
Get localized text for message object and format message in default locale.

Parameters:
mo - message object to localize.
args - arguments for the message.
Returns:
localized message.

getLocalizedText

public static java.lang.String getLocalizedText(MsgObject mo,
                                                java.lang.Object[] args,
                                                java.lang.String language)
Get localized text for message object and format message in specific locale.

Parameters:
language - 2-letter ISO language code.
mo - message object to localize.
args - arguments for the message.
Returns:
localized message.