| java.lang.Object org.tigris.scarab.tools.localization.L10NMessage
L10NMessage | public class L10NMessage implements Localizable(Code) | | This class defines localizable messages. Each Resource
may contain dynamic parameters ({$1}, {$2}, etc.) These
parameters get resolved, when the ResourceBundle is called
for the String representation of a specific Resource key.
L10NMessage always contains an L10N key and may contain
an arbitrary set of parameters, which will be used as values
for the {$n} variables in the Resource.
Note: We check for two special cases:
- If a paramater is itself an L10NInstance, it will be resolved,
before it's value is used.
- If a parameter is a scarabException, it is resolved, before
it's value is used.
- If a parameter is an ordinary Exception, it's stored message is
retrieved via Exception.getMessage() before it's value is used.
author: Hussayn Dabbous |
Method Summary | |
public String | getMessage() resolve the instance to the ScarabLocalizationTool.DEFAULT_LOCALE
Note: This method returns english messages independent of
any l10n settings. | public String | getMessage(ScarabLocalizationTool l10n) Format the message using the specified ScarabLocalizationTool instance. |
L10NMessage | public L10NMessage(LocalizationKey theKey)(Code) | | Constructor always needs the L10N key for creation.
Parameters: theKey - |
L10NMessage | public L10NMessage(LocalizationKey theKey, Object[] theParameters)(Code) | | Constructor with parameters. theParameters is an array of objects
and may contain Exceptions and
L10NInstances.
Parameters: theKey - Parameters: theParameters - |
L10NMessage | public L10NMessage(LocalizationKey theKey, Object p1)(Code) | | Convenience constructor with one extra parameter.
Parameters: theKey - Parameters: p1 - |
L10NMessage | public L10NMessage(LocalizationKey theKey, Object p1, Object p2)(Code) | | Convenience constructor with two extra parameters.
Parameters: theKey - Parameters: p1 - Parameters: p2 - |
L10NMessage | public L10NMessage(LocalizationKey theKey, Object p1, Object p2, Object p3)(Code) | | Convenience constructor with three extra parameters.
Parameters: theKey - Parameters: p1 - Parameters: p2 - Parameters: p3 - |
getMessage | public String getMessage()(Code) | | resolve the instance to the ScarabLocalizationTool.DEFAULT_LOCALE
Note: This method returns english messages independent of
any l10n settings. it is preferreable to use
resolve(ScarabLocalizationTool) the resolved String |
getMessage | public String getMessage(ScarabLocalizationTool l10n)(Code) | | Format the message using the specified ScarabLocalizationTool instance.
The parameters are resolved recursively if necessary.
a localized String representation of this message. |
|
|