Package org.molgenis.i18n
Interface ContextMessageSource
-
- All Known Implementing Classes:
ContextMessageSourceImpl
public interface ContextMessageSourceReturns messages based on theLocaleContextHolder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetMessage(String code)Returns the message in the locale of the current user.StringgetMessage(String code, Object[] args)Returns the message in the locale of the current user.
-
-
-
Method Detail
-
getMessage
String getMessage(String code)
Returns the message in the locale of the current user.- Parameters:
code- the code to lookup up, such as 'calculator.noRateSet'- Returns:
- the resolved message, never null
- Throws:
org.springframework.context.NoSuchMessageException- if the message wasn't found
-
getMessage
String getMessage(String code, @Nullable @CheckForNull Object[] args)
Returns the message in the locale of the current user.- Parameters:
code- the code to lookup up, such as 'calculator.noRateSet'args- an array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), * ornullif none.- Returns:
- the resolved message, never null
- Throws:
org.springframework.context.NoSuchMessageException- if the message wasn't found
-
-