public class DefaultLocalizedMessageProvider extends Object implements LocalizedMessageProvider
INSTANCE
Constructor and Description |
---|
DefaultLocalizedMessageProvider() |
Modifier and Type | Method and Description |
---|---|
protected MessageFormat |
findMessageFormat(String code,
Locale locale) |
String |
getFeatureName() |
static Locale |
getLocaleForBundle(Locale locale)
Determines the locale used for resource bundle lookups
|
String |
getMessage(String code,
Object[] args,
Locale locale)
Returns the localized message for the given code, arguments and locale if existing,
null otherwise. |
boolean |
isActiveFeature()
Checks if the feature is activated
|
protected MessageFormat |
resolveMessageFormat(String code,
Locale locale) |
public static Locale getLocaleForBundle(Locale locale)
locale
- the localepublic String getMessage(String code, Object[] args, Locale locale)
LocalizedMessageProvider
null
otherwise.
The method does not throw and returns code
in case of any errors.getMessage
in interface LocalizedMessageProvider
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.public boolean isActiveFeature()
Feature
isActiveFeature
in interface Feature
public String getFeatureName()
getFeatureName
in interface Feature
protected MessageFormat findMessageFormat(String code, Locale locale)
protected MessageFormat resolveMessageFormat(String code, Locale locale)
Copyright © 2020. All rights reserved.