Package de.xima.fc.mdl
Class FCMessage
java.lang.Object
de.xima.fc.mdl.FCMessage
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FCMessage
A message that may be shown to the user. This message only stores the I18N keys for the localized strings, it does
not know about the current locale. The current locale is only known for the current view or session, so this is used
in the backend to avoid creating a dependency on the UI.
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static interface
-
Constructor Summary
ConstructorsConstructorDescriptionFCMessage
(FCMessage.ESeverity severity, String i18nMessage, FCMessage.ParamsLocalizer params) Use this instead ofFCMessage(ESeverity, String, Serializable...)
in case the parameters depend on the locale as well.FCMessage
(FCMessage.ESeverity severity, String i18nMessage, Serializable... params) FCMessage
(FCMessage.ESeverity severity, String i18nTitle, String i18nMessage, FCMessage.ParamsLocalizer params) Use this instead ofFCMessage(ESeverity, String, String, Serializable...)
in case the parameters depend on the locale as well.FCMessage
(FCMessage.ESeverity severity, String i18nTitle, String i18nMessage, Serializable... params) -
Method Summary
Modifier and TypeMethodDescriptionPrefergetParams(Locale)
if the locale is known.The parameters of the message may depend on the locale as well.
-
Constructor Details
-
FCMessage
- Parameters:
severity
- The severity of this message.i18nMessage
- i18n key of the message details to be shown.params
- Optional parameters for the message. Occurrences of{0}
,{1}
in the message are replaced with these parameters.
-
FCMessage
public FCMessage(FCMessage.ESeverity severity, String i18nMessage, FCMessage.ParamsLocalizer params) Use this instead ofFCMessage(ESeverity, String, Serializable...)
in case the parameters depend on the locale as well. This constructor creates a message with no title (summary).- Parameters:
severity
- The severity of this message.i18nMessage
- i18n key of the message details to be shown.params
- Function that receives the desired locale and returns the localized parameters. UseLocalizer
to retrieve i18n strings for the given locale.
-
FCMessage
public FCMessage(FCMessage.ESeverity severity, String i18nTitle, String i18nMessage, Serializable... params) - Parameters:
severity
- The severity of this message.i18nTitle
- i18n key of the message summary to be shown.i18nMessage
- i18n key of the message details to be shown.params
- Function that receives the desired locale and returns the localized parameters. UseLocalizer
to retrieve i18n strings for the given locale.
-
FCMessage
public FCMessage(FCMessage.ESeverity severity, String i18nTitle, String i18nMessage, FCMessage.ParamsLocalizer params) Use this instead ofFCMessage(ESeverity, String, String, Serializable...)
in case the parameters depend on the locale as well.- Parameters:
severity
- The severity of this message.i18nTitle
- i18n key of the message summary to be shown.i18nMessage
- i18n key of the message details to be shown.params
- Function that receives the desired locale and returns the localized parameters. UseLocalizer
to retrieve i18n strings for the given locale.
-
-
Method Details
-
getI18nTitle
- Returns:
- i18n key of the message summary to be shown.
-
getI18nMessage
- Returns:
- i18n key of the message details to be shown.
-
getParams
The parameters of the message may depend on the locale as well.- Parameters:
locale
- The desired locale.- Returns:
- The optional parameters for this message, for the given locale.
-
getParams
PrefergetParams(Locale)
if the locale is known.- Returns:
- The optional parameters for this message, for the given locale.
-
getSeverity
- Returns:
- The severity of this message, eg. error, warning etc.
-