Package org.molgenis.i18n
Class ContextMessageSourceImpl
- java.lang.Object
-
- org.molgenis.i18n.ContextMessageSourceImpl
-
- All Implemented Interfaces:
ContextMessageSource
@Component public class ContextMessageSourceImpl extends Object implements ContextMessageSource
-
-
Constructor Summary
Constructors Constructor Description ContextMessageSourceImpl()
-
Method Summary
All Methods Instance Methods Concrete 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
public String getMessage(String code)
Description copied from interface:ContextMessageSourceReturns the message in the locale of the current user.- Specified by:
getMessagein interfaceContextMessageSource- Parameters:
code- the code to lookup up, such as 'calculator.noRateSet'- Returns:
- the resolved message, never null
-
getMessage
public String getMessage(String code, @Nullable @CheckForNull Object[] args)
Description copied from interface:ContextMessageSourceReturns the message in the locale of the current user.- Specified by:
getMessagein interfaceContextMessageSource- 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
-
-