Package io.jmix.core.impl
Class MessagesImpl
java.lang.Object
io.jmix.core.impl.MessagesImpl
- All Implemented Interfaces:
Messages
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CurrentAuthenticationprotected org.springframework.context.MessageSource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected StringfallbackMessageOrKey(String group, String key, Locale locale) protected StringfallbackMessageOrNull(String group, String key, Locale locale) 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 providedprotected Stringprotected Localeprotected StringgetMessage(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.protected Locale
-
Field Details
-
messageSource
@Autowired protected org.springframework.context.MessageSource messageSource -
currentAuthentication
-
-
Constructor Details
-
MessagesImpl
public MessagesImpl()
-
-
Method Details
-
getMessage
Description copied from interface:MessagesReturns localized message.
Locale is determined by the current user session.- Specified by:
getMessagein interfaceMessages- Parameters:
key- message key- Returns:
- localized message or the key if the message not found
-
getMessage
Description copied from interface:MessagesReturns localized message.- Specified by:
getMessagein interfaceMessages- Parameters:
key- message keylocale- message locale- Returns:
- localized message or the key if the message not found
-
getMessage
Description copied from interface:MessagesReturns localized message.
Locale is determined by the current user session.- Specified by:
getMessagein interfaceMessages- Parameters:
caller- determines the message group as class' package namekey- message key- Returns:
- localized message or the key if the message not found
-
getMessage
Description copied from interface:MessagesReturns localized message.- Specified by:
getMessagein interfaceMessages- 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
Description copied from interface:MessagesReturns localized message.
Locale is determined by the current user session.- Specified by:
getMessagein interfaceMessages- 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
Description copied from interface:MessagesReturns localized message.- Specified by:
getMessagein interfaceMessages- 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
Description copied from interface:MessagesReturns localized message. Locale is determined by the current user session.- Specified by:
getMessagein interfaceMessages- Parameters:
group- message groupkey- message key- Returns:
- localized message or the key if the message not found
-
getMessage
Description copied from interface:MessagesReturns localized message.- Specified by:
getMessagein interfaceMessages- Parameters:
group- message groupkey- message keylocale- message locale- Returns:
- localized message or the key if the message not found
-
formatMessage
Description copied from interface:MessagesGet localized message and use it as a format string for parameters provided.
Locale is determined by the current user session.- Specified by:
formatMessagein interfaceMessages- 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
Description copied from interface:MessagesGet localized message and use it as a format string for parameters provided- Specified by:
formatMessagein interfaceMessages- 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
Description copied from interface:MessagesGet localized message and use it as a format string for parameters provided.
Locale is determined by the current user session.- Specified by:
formatMessagein interfaceMessages- Parameters:
group- message groupkey- message keyparams- parameter values- Returns:
- formatted string or the key in case of IllegalFormatException
-
formatMessage
Description copied from interface:MessagesGet localized message and use it as a format string for parameters provided- Specified by:
formatMessagein interfaceMessages- Parameters:
group- message groupkey- message keylocale- message localeparams- parameter values- Returns:
- formatted string or the key in case of IllegalFormatException
-
findMessage
Description copied from interface:MessagesReturns localized message or null if not found.- Specified by:
findMessagein interfaceMessages- Parameters:
key- message keylocale- message locale. If null, current user locale is used.- Returns:
- localized message or null if the message not found
-
findMessage
Description copied from interface:MessagesReturns localized message or null if not found.- Specified by:
findMessagein interfaceMessages- 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
public void clearCache()- Specified by:
clearCachein interfaceMessages
-
getCode
-
getUserLocale
-
getDefaultLocale
-
getGroup
-
fallbackMessageOrKey
-
fallbackMessageOrNull
-