Class StringFormatI18nMessageFormatter

java.lang.Object
org.nuiton.i18n.format.StringFormatI18nMessageFormatter
All Implemented Interfaces:
I18nMessageFormatter

public class StringFormatI18nMessageFormatter extends Object implements I18nMessageFormatter
Implementation of I18nMessageFormatter based on Formatter syntax. Note: This is the default message formatter used by i18n system.
Since:
2.4
See Also:
  • Constructor Details

    • StringFormatI18nMessageFormatter

      public StringFormatI18nMessageFormatter()
  • Method Details

    • format

      public String format(Locale locale, String message, Object... args)
      Description copied from interface: I18nMessageFormatter
      Format a given message with locale and optinal args. The main purpose is to replace placeholders in message with args value. This may depend on locale for date purpose for example.
      Specified by:
      format in interface I18nMessageFormatter
      Parameters:
      locale - locale to use for formatting (number, date, ...)
      message - message to format (that contains placeholders)
      args - object array to use in formatting the message
      Returns:
      the formatted message