/** * Retrieve the message for the given code and the given Locale. * @param code code of the message * @param defaultMessage the String to return if the lookup fails * @param locale the Locale in which to do lookup * @return the message */ public String getMessage(String code, String defaultMessage, Locale locale) { String msg = this.messageSource.getMessage(code, null, defaultMessage, locale); return (msg != null ? msg : ""); }
/** * Retrieve the message for the given code and the given Locale. * @param code code of the message * @param locale the Locale in which to do lookup * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getMessage(String code, Locale locale) throws NoSuchMessageException { return this.messageSource.getMessage(code, null, locale); }
/** * Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance) * in the given Locale. * @param resolvable the MessageSourceResolvable * @param locale the Locale in which to do lookup * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException { return this.messageSource.getMessage(resolvable, locale); }
/** * Retrieve the message for the given code and the given Locale. * @param code code of the message * @param args arguments for the message, or {@code null} if none * @param locale the Locale in which to do lookup * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getMessage(String code, @Nullable Object[] args, Locale locale) throws NoSuchMessageException { return this.messageSource.getMessage(code, args, locale); }
/** * Retrieve the message for the given code and the given Locale. * @param code code of the message * @param args arguments for the message, or {@code null} if none * @param defaultMessage the String to return if the lookup fails * @param locale the Locale in which to do lookup * @return the message */ public String getMessage(String code, @Nullable Object[] args, String defaultMessage, Locale locale) { String msg = this.messageSource.getMessage(code, args, defaultMessage, locale); return (msg != null ? msg : ""); }
@Override public String getMessage(String code, @Nullable Object[] args, @Nullable String defaultMessage, Locale locale) { return this.messageSource.getMessage(code, args, defaultMessage, locale); }
@Override public String getMessage(String code, @Nullable Object[] args, Locale locale) throws NoSuchMessageException { if (this.parentMessageSource != null) { return this.parentMessageSource.getMessage(code, args, locale); } else { throw new NoSuchMessageException(code, locale); } }
/** * Retrieve the message for the given code and the default Locale. * @param code code of the message * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getMessage(String code) throws NoSuchMessageException { return this.messageSource.getMessage(code, null, getDefaultLocale()); }
/** * Retrieve the message for the given code and the default Locale. * @param code code of the message * @param args arguments for the message, or {@code null} if none * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getMessage(String code, @Nullable Object[] args) throws NoSuchMessageException { return this.messageSource.getMessage(code, args, getDefaultLocale()); }
/** * Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance). * @param resolvable the MessageSourceResolvable * @param htmlEscape if the message should be HTML-escaped * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getMessage(MessageSourceResolvable resolvable, boolean htmlEscape) throws NoSuchMessageException { String msg = this.messageSource.getMessage(resolvable, this.locale); return (htmlEscape ? HtmlUtils.htmlEscape(msg) : msg); }
/** * Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance) * in the default Locale. * @param resolvable the MessageSourceResolvable * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getMessage(MessageSourceResolvable resolvable) throws NoSuchMessageException { return this.messageSource.getMessage(resolvable, getDefaultLocale()); }
/** * Retrieve the message for the given code and the default Locale. * @param code code of the message * @param defaultMessage the String to return if the lookup fails * @return the message */ public String getMessage(String code, String defaultMessage) { String msg = this.messageSource.getMessage(code, null, defaultMessage, getDefaultLocale()); return (msg != null ? msg : ""); }
/** * Retrieve the message for the given code and the default Locale. * @param code code of the message * @param args arguments for the message, or {@code null} if none * @param defaultMessage the String to return if the lookup fails * @return the message */ public String getMessage(String code, @Nullable Object[] args, String defaultMessage) { String msg = this.messageSource.getMessage(code, args, defaultMessage, getDefaultLocale()); return (msg != null ? msg : ""); }
/** * Retrieve the message for the given code. * @param code code of the message * @param args arguments for the message, or {@code null} if none * @param htmlEscape if the message should be HTML-escaped * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getMessage(String code, @Nullable Object[] args, boolean htmlEscape) throws NoSuchMessageException { String msg = this.messageSource.getMessage(code, args, this.locale); return (htmlEscape ? HtmlUtils.htmlEscape(msg) : msg); }
@Override public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException { return getMessageSource().getMessage(resolvable, locale); }
/** * Retrieve the theme message for the given code. * <p>Note that theme messages are never HTML-escaped, as they typically denote * theme-specific resource paths and not client-visible messages. * @param code code of the message * @param args arguments for the message as a List, or {@code null} if none * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getThemeMessage(String code, @Nullable List<?> args) throws NoSuchMessageException { return getTheme().getMessageSource().getMessage(code, (args != null ? args.toArray() : null), getLocale()); }
/** * Retrieve the theme message for the given code. * <p>Note that theme messages are never HTML-escaped, as they typically denote * theme-specific resource paths and not client-visible messages. * @param code code of the message * @param args arguments for the message, or {@code null} if none * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getThemeMessage(String code, @Nullable Object[] args) throws NoSuchMessageException { return getTheme().getMessageSource().getMessage(code, args, getLocale()); }
/** * Retrieve the given MessageSourceResolvable in the current theme. * <p>Note that theme messages are never HTML-escaped, as they typically denote * theme-specific resource paths and not client-visible messages. * @param resolvable the MessageSourceResolvable * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getThemeMessage(MessageSourceResolvable resolvable) throws NoSuchMessageException { return getTheme().getMessageSource().getMessage(resolvable, getLocale()); }
/** * Retrieve the theme message for the given code. * <p>Note that theme messages are never HTML-escaped, as they typically denote * theme-specific resource paths and not client-visible messages. * @param code code of the message * @return the message * @throws org.springframework.context.NoSuchMessageException if not found */ public String getThemeMessage(String code) throws NoSuchMessageException { return getTheme().getMessageSource().getMessage(code, null, getLocale()); }
/** * Retrieve the theme message for the given code. * <p>Note that theme messages are never HTML-escaped, as they typically denote * theme-specific resource paths and not client-visible messages. * @param code code of the message * @param defaultMessage the String to return if the lookup fails * @return the message */ public String getThemeMessage(String code, String defaultMessage) { String msg = getTheme().getMessageSource().getMessage(code, null, defaultMessage, getLocale()); return (msg != null ? msg : ""); }