public interface LocalizedMessageProvider
LocalizedMessageProvider
is capable to build localized messages based on string formats in the application's resource bundles.Modifier and Type | Method and Description |
---|---|
String |
get(String code,
Object[] args,
Locale locale)
Returns the localized message for the given code, arguments and locale if existing,
null otherwise. |
default void |
setPrevious(LocalizedMessageProvider previous)
Passes the latest configured
LocalizedMessageProvider during configuration phase when this instances gets registered. |
String get(String code, Object[] args, Locale locale)
null
otherwise.
The method does not throw and returns code
in case of any errors.code
- The code which is used as key for the format string in the defined bundles.args
- The argument objects for the format stringlocale
- The locale to be used. If no locale is set the default locale is taken.null
if the code is not resolvable.default void setPrevious(LocalizedMessageProvider previous)
LocalizedMessageProvider
during configuration phase when this instances gets registered.
The previous provider can be used to build an adapted provider on top.previous
- The previously registered provider.Copyright © 2022. All rights reserved.