Package com.netscape.certsrv.base
Class MessageFormatter
java.lang.Object
com.netscape.certsrv.base.MessageFormatter
Factors out common function of formatting internatinalized
messages taking arguments and using java.util.ResourceBundle
and java.text.MessageFormat mechanism.
- Version:
- $Revision$, $Date$
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getLocalizedString
(Locale locale, String resourceBundleBaseName, String formatString) Retrieves the localized string.static String
getLocalizedString
(Locale locale, String resourceBundleBaseName, String formatString, Object params) Retrieves the localized string.static String
getLocalizedString
(Locale locale, String resourceBundleBaseName, String formatString, Object[] params) Retrieves the localized string.
-
Constructor Details
-
MessageFormatter
public MessageFormatter()
-
-
Method Details
-
getLocalizedString
public static String getLocalizedString(Locale locale, String resourceBundleBaseName, String formatString) Retrieves the localized string.- Parameters:
locale
- end user localeresourceBundleBaseName
- resource bundle class nameformatString
- format string- Returns:
- localized string
-
getLocalizedString
public static String getLocalizedString(Locale locale, String resourceBundleBaseName, String formatString, Object params) Retrieves the localized string.- Parameters:
locale
- end user localeresourceBundleBaseName
- resource bundle class nameformatString
- format stringparams
- parameters to be substituted- Returns:
- localized string
-
getLocalizedString
public static String getLocalizedString(Locale locale, String resourceBundleBaseName, String formatString, Object[] params) Retrieves the localized string.- Parameters:
locale
- end user localeresourceBundleBaseName
- resource bundle class nameformatString
- format stringparams
- parameters to be substituted- Returns:
- localized string
-