Interface LocalizedMessageProvider


public interface LocalizedMessageProvider
A LocalizedMessageProvider is capable to build localized messages based on string formats in the application's resource bundles.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(String code, Object[] args, Locale locale)
    Returns the localized message for the given code, arguments and locale if existing, null otherwise.
    default void
    Passes the latest configured LocalizedMessageProvider during configuration phase when this instances gets registered.
  • Method Details

    • get

      String get(String code, Object[] args, Locale locale)
      Returns the localized message for the given code, arguments and locale if existing, null otherwise. The method does not throw and returns code in case of any errors.
      Parameters:
      code - The code which is used as key for the format string in the defined bundles.
      args - The argument objects for the format string
      locale - The locale to be used. If no locale is set the default locale is taken.
      Returns:
      The localized message or null if the code is not resolvable.
    • setPrevious

      default void setPrevious(LocalizedMessageProvider previous)
      Passes the latest configured LocalizedMessageProvider during configuration phase when this instances gets registered. The previous provider can be used to build an adapted provider on top.
      Parameters:
      previous - The previously registered provider.