Code example for MessageFormat

Methods: formatsetLocale

0
   * @param parameters the parameter collection for the message 
   * @return the formated string 
   */ 
  public String formatMessage(final String key, final Object[] parameters)
  { 
    final MessageFormat format = new MessageFormat(strictString(key));
    format.setLocale(getLocale());
    return format.format(parameters);
  } 
 
  public String getString(final String key, final Object[] parameters)
  { 
    try 
    { 
      return formatMessage(key, parameters);
    } 
    catch (MissingResourceException mre)
    { 
      logger.warn("ResourceBundleSupport#getString(,,)", mre);
      return '!' + key + '!';
    }