Package ubic.gemma.web.util
Class MessageUtilImpl
- java.lang.Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- ubic.gemma.web.util.MessageUtilImpl
-
- All Implemented Interfaces:
Aware
,ApplicationContextAware
,MessageUtil
@Component public class MessageUtilImpl extends ApplicationObjectSupport implements MessageUtil
- Author:
- pavlidis
-
-
Field Summary
-
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
-
-
Constructor Summary
Constructors Constructor Description MessageUtilImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getText(String msgKey, Object[] args, Locale locale)
Convenience method for getting a i18n key's value with arguments.String
getText(String msgKey, String arg, Locale locale)
Convenient method for getting a i18n key's value with a single string argument.String
getText(String msgKey, Locale locale)
Convenience method for getting a i18n key's value.void
saveMessage(javax.servlet.http.HttpServletRequest request, String msg)
Put a message into the session.void
saveMessage(javax.servlet.http.HttpServletRequest request, String key, Object[] parameters, String defaultMessage)
Put a message into the session.void
saveMessage(javax.servlet.http.HttpServletRequest request, String key, Object parameter, String defaultMessage)
Put a message into the session.void
saveMessage(javax.servlet.http.HttpServletRequest request, String key, String defaultMessage)
Put a message into the session.void
saveMessage(javax.servlet.http.HttpSession session, String msg)
Put a message into the session.-
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
-
-
-
-
Method Detail
-
getText
public String getText(String msgKey, Locale locale)
Description copied from interface:MessageUtil
Convenience method for getting a i18n key's value. Implementation note: Calling getMessageSourceAccessor() is used because the RequestContext variable is not set in unit tests b/c there's no DispatchServlet Request.- Specified by:
getText
in interfaceMessageUtil
- Parameters:
msgKey
- keylocale
- the current locale- Returns:
- text
-
getText
public String getText(String msgKey, Object[] args, Locale locale)
Description copied from interface:MessageUtil
Convenience method for getting a i18n key's value with arguments.- Specified by:
getText
in interfaceMessageUtil
- Parameters:
msgKey
- keyargs
- argslocale
- the current locale- Returns:
- text
-
getText
public String getText(String msgKey, String arg, Locale locale)
Description copied from interface:MessageUtil
Convenient method for getting a i18n key's value with a single string argument.- Specified by:
getText
in interfaceMessageUtil
- Parameters:
msgKey
- message keyarg
- argumentlocale
- the current locale- Returns:
- text
-
saveMessage
public void saveMessage(javax.servlet.http.HttpServletRequest request, String msg)
Description copied from interface:MessageUtil
Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.- Specified by:
saveMessage
in interfaceMessageUtil
- Parameters:
request
- requestmsg
- msg
-
saveMessage
public void saveMessage(javax.servlet.http.HttpServletRequest request, String key, Object parameter, String defaultMessage)
Description copied from interface:MessageUtil
Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.- Specified by:
saveMessage
in interfaceMessageUtil
- Parameters:
request
- requestparameter
- parameter to be filled into the message.defaultMessage
- default message
-
saveMessage
public void saveMessage(javax.servlet.http.HttpServletRequest request, String key, Object[] parameters, String defaultMessage)
Description copied from interface:MessageUtil
Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.- Specified by:
saveMessage
in interfaceMessageUtil
- Parameters:
request
- requestparameters
- Array of parameters to be filled into the message.defaultMessage
- default message
-
saveMessage
public void saveMessage(javax.servlet.http.HttpServletRequest request, String key, String defaultMessage)
Description copied from interface:MessageUtil
Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.- Specified by:
saveMessage
in interfaceMessageUtil
- Parameters:
request
- requestkey
- keydefaultMessage
- default message
-
saveMessage
public void saveMessage(javax.servlet.http.HttpSession session, String msg)
Description copied from interface:MessageUtil
Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.- Specified by:
saveMessage
in interfaceMessageUtil
- Parameters:
session
- sessionmsg
- msg
-
-