org.clapper.util.misc
Class BundleUtil
- java.lang.Object
-
- org.clapper.util.misc.BundleUtil
-
public final class BundleUtil extends java.lang.ObjectResourceBundle utilities to aid in localization.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.lang.StringgetMessage(java.lang.String bundleName, java.util.Locale locale, java.lang.String key, java.lang.Object[] params)Get a localized message from the bundle.static java.lang.StringgetMessage(java.lang.String bundleName, java.util.Locale locale, java.lang.String key, java.lang.String defaultMsg)Get a localized message from a bundle.static java.lang.StringgetMessage(java.lang.String bundleName, java.util.Locale locale, java.lang.String key, java.lang.String defaultMsg, java.lang.Object[] params)Get a localized message from the bundle.static java.lang.StringgetMessage(java.lang.String bundleName, java.lang.String key, java.lang.Object[] params)Get a message from the bundle using the default locale.static java.lang.StringgetString(java.lang.String bundleName, java.lang.String key)Get a string from a bundle, using the default locale.static java.lang.StringgetString(java.lang.String bundleName, java.lang.String key, java.lang.String defaultMsg)Get a string from a bundle, using the default locale.
-
-
-
Method Detail
-
getString
public static java.lang.String getString(java.lang.String bundleName, java.lang.String key)Get a string from a bundle, using the default locale.- Parameters:
bundleName- the bundle namekey- the key to look up- Returns:
- the value for the key, or the default value
-
getString
public static java.lang.String getString(java.lang.String bundleName, java.lang.String key, java.lang.String defaultMsg)Get a string from a bundle, using the default locale.- Parameters:
bundleName- the bundle namekey- the key to look updefaultMsg- the default value, or null- Returns:
- the value for the key, or the default value
-
getMessage
public static java.lang.String getMessage(java.lang.String bundleName, java.util.Locale locale, java.lang.String key, java.lang.String defaultMsg)Get a localized message from a bundle.- Parameters:
bundleName- the name of the resource bundlelocale- the localekey- the keydefaultMsg- the default message- Returns:
- the message, or the default
-
getMessage
public static java.lang.String getMessage(java.lang.String bundleName, java.lang.String key, java.lang.Object[] params)Get a message from the bundle using the default locale.- Parameters:
bundleName- the name of the resource bundlekey- the keyparams- parameters for the message- Returns:
- the message, or the default
-
getMessage
public static java.lang.String getMessage(java.lang.String bundleName, java.util.Locale locale, java.lang.String key, java.lang.String defaultMsg, java.lang.Object[] params)Get a localized message from the bundle.- Parameters:
bundleName- the name of the resource bundlelocale- the localekey- the keydefaultMsg- the default messageparams- parameters for the message- Returns:
- the message, or the default
-
getMessage
public static java.lang.String getMessage(java.lang.String bundleName, java.util.Locale locale, java.lang.String key, java.lang.Object[] params)Get a localized message from the bundle.- Parameters:
bundleName- the name of the resource bundlelocale- the localekey- the keyparams- parameters for the message- Returns:
- the message, or the default
-
-
DMelt 3.0 © DataMelt by jWork.ORG