| java.lang.Object org.springframework.context.support.MessageSourceAccessor
MessageSourceAccessor | public class MessageSourceAccessor (Code) | | Helper class for easy access to messages from a MessageSource,
providing various overloaded getMessage methods.
Available from ApplicationObjectSupport, but also reusable
as a standalone helper to delegate to in application objects.
author: Juergen Hoeller since: 23.10.2003 See Also: ApplicationObjectSupport.getMessageSourceAccessor |
Method Summary | |
protected Locale | getDefaultLocale() Return the default locale to use if no explicit locale has been given. | public String | getMessage(String code, String defaultMessage) Retrieve the message for the given code and the default Locale. | public String | getMessage(String code, String defaultMessage, Locale locale) Retrieve the message for the given code and the given Locale. | public String | getMessage(String code, Object[] args, String defaultMessage) Retrieve the message for the given code and the default Locale. | public String | getMessage(String code, Object[] args, String defaultMessage, Locale locale) Retrieve the message for the given code and the given Locale. | public String | getMessage(String code) Retrieve the message for the given code and the default Locale. | public String | getMessage(String code, Locale locale) Retrieve the message for the given code and the given Locale. | public String | getMessage(String code, Object[] args) Retrieve the message for the given code and the default Locale. | public String | getMessage(String code, Object[] args, Locale locale) Retrieve the message for the given code and the given Locale. | public String | getMessage(MessageSourceResolvable resolvable) Retrieve the given MessageSourceResolvable (e.g. | public String | getMessage(MessageSourceResolvable resolvable, Locale locale) Retrieve the given MessageSourceResolvable (e.g. |
MessageSourceAccessor | public MessageSourceAccessor(MessageSource messageSource, Locale defaultLocale)(Code) | | Create a new MessageSourceAccessor, using the given default locale.
Parameters: messageSource - the MessageSource to wrap Parameters: defaultLocale - the default locale to use for message access |
getMessage | public String getMessage(String code, String defaultMessage)(Code) | | Retrieve the message for the given code and the default Locale.
Parameters: code - code of the message Parameters: defaultMessage - String to return if the lookup fails the message |
getMessage | public String getMessage(String code, String defaultMessage, Locale locale)(Code) | | Retrieve the message for the given code and the given Locale.
Parameters: code - code of the message Parameters: defaultMessage - String to return if the lookup fails Parameters: locale - Locale in which to do lookup the message |
getMessage | public String getMessage(String code, Object[] args, String defaultMessage)(Code) | | Retrieve the message for the given code and the default Locale.
Parameters: code - code of the message Parameters: args - arguments for the message, or null if none Parameters: defaultMessage - String to return if the lookup fails the message |
getMessage | public String getMessage(String code, Object[] args, String defaultMessage, Locale locale)(Code) | | Retrieve the message for the given code and the given Locale.
Parameters: code - code of the message Parameters: args - arguments for the message, or null if none Parameters: defaultMessage - String to return if the lookup fails Parameters: locale - Locale in which to do lookup the message |
|
|