Package io.jmix.core
Interface Messages
- All Known Implementing Classes:
MessagesImpl
public interface Messages
Central interface to work with localized messages.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
findMessage
(String group, String key, Locale locale) Returns localized message or null if not found.findMessage
(String key, Locale locale) Returns localized message or null if not found.formatMessage
(Class caller, String key, Object... params) Get localized message and use it as a format string for parameters provided.
Locale is determined by the current user session.formatMessage
(Class caller, String key, Locale locale, Object... params) Get localized message and use it as a format string for parameters providedformatMessage
(String group, String key, Object... params) Get localized message and use it as a format string for parameters provided.
Locale is determined by the current user session.formatMessage
(String group, String key, Locale locale, Object... params) Get localized message and use it as a format string for parameters providedgetMessage
(Class caller, String key) Returns localized message.
Locale is determined by the current user session.getMessage
(Class caller, String key, Locale locale) Returns localized message.getMessage
(Enum caller) Returns localized message.
Locale is determined by the current user session.getMessage
(Enum caller, Locale locale) Returns localized message.getMessage
(String key) Returns localized message.
Locale is determined by the current user session.getMessage
(String group, String key) Returns localized message.getMessage
(String group, String key, Locale locale) Returns localized message.getMessage
(String key, Locale locale) Returns localized message.
-
Method Details
-
getMessage
Returns localized message.
Locale is determined by the current user session.- Parameters:
key
- message key- Returns:
- localized message or the key if the message not found
-
getMessage
Returns localized message.- Parameters:
key
- message keylocale
- message locale- Returns:
- localized message or the key if the message not found
-
getMessage
Returns localized message.
Locale is determined by the current user session.- Parameters:
caller
- determines the message group as class' package namekey
- message key- Returns:
- localized message or the key if the message not found
-
getMessage
Returns localized message.- Parameters:
caller
- determines the message group as class' package namekey
- message keylocale
- message locale- Returns:
- localized message or the key if the message not found
-
getMessage
Returns localized message.
Locale is determined by the current user session.- Parameters:
caller
- enum determining the message group and key:- group - enum's package name
- key - enum's short class name (after last dot), plus dot, plus enum value
- Returns:
- localized message or the key if the message not found
-
getMessage
Returns localized message.- Parameters:
caller
- enum determining the message group and key:- group - enum's package name
- key - enum's short class name (after last dot), plus dot, plus enum value
locale
- message locale- Returns:
- localized message or the key if the message not found
-
getMessage
Returns localized message. Locale is determined by the current user session.- Parameters:
group
- message groupkey
- message key- Returns:
- localized message or the key if the message not found
-
getMessage
Returns localized message.- Parameters:
group
- message groupkey
- message keylocale
- message locale- Returns:
- localized message or the key if the message not found
-
formatMessage
Get localized message and use it as a format string for parameters provided.
Locale is determined by the current user session.- Parameters:
caller
- determines the message group as class' package namekey
- message keyparams
- parameter values- Returns:
- formatted string or the key in case of IllegalFormatException
-
formatMessage
Get localized message and use it as a format string for parameters provided- Parameters:
caller
- determines the message group as class' package namekey
- message keylocale
- message localeparams
- parameter values- Returns:
- formatted string or the key in case of IllegalFormatException
-
formatMessage
Get localized message and use it as a format string for parameters provided.
Locale is determined by the current user session.- Parameters:
group
- message groupkey
- message keyparams
- parameter values- Returns:
- formatted string or the key in case of IllegalFormatException
-
formatMessage
Get localized message and use it as a format string for parameters provided- Parameters:
group
- message groupkey
- message keylocale
- message localeparams
- parameter values- Returns:
- formatted string or the key in case of IllegalFormatException
-
findMessage
Returns localized message or null if not found.- Parameters:
key
- message keylocale
- message locale. If null, current user locale is used.- Returns:
- localized message or null if the message not found
-
findMessage
Returns localized message or null if not found.- Parameters:
group
- message groupkey
- message keylocale
- message locale. If null, current user locale is used.- Returns:
- localized message or null if the message not found
-
clearCache
void clearCache()
-