Package org.apache.uima.internal.util
Class I18nUtil
java.lang.Object
org.apache.uima.internal.util.I18nUtil
Internationaliation utilities.
Static methods only
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
localizeMessage
(String aResourceBundleName, String aMessageKey, Object[] aArguments) Localize a message to the default Locale.static String
localizeMessage
(String aResourceBundleName, String aMessageKey, Object[] aArguments, ClassLoader aLoader) Localize a message to the default Locale.static String
localizeMessage
(String aResourceBundleName, Locale aLocale, String aMessageKey, Object[] aArguments) Localize a message to a specified Locale.static String
localizeMessage
(String aResourceBundleName, Locale aLocale, String aMessageKey, Object[] aArguments, ClassLoader aLoader) Localize a message to a specified Locale.static String
localizeMessage
(ResourceBundle aResourceBundle, Locale aLocale, String aMessageKey, Object[] aArguments) Localize a message to a specified Locale.static void
static ResourceBundle
resolveResourceBundle
(String aResourceBundleName, Locale aLocale, ClassLoader aLoader) static void
setTccl
(ClassLoader tccl)
-
Constructor Details
-
I18nUtil
public I18nUtil()
-
-
Method Details
-
localizeMessage
public static String localizeMessage(String aResourceBundleName, String aMessageKey, Object[] aArguments) Localize a message to the default Locale.- Parameters:
aResourceBundleName
- base name of resource bundleaMessageKey
- key of message to localizeaArguments
- arguments to message (may be null if none)- Returns:
- localized message. If an exception occurs, returns "MESSAGE LOCALIZATION FAILED:" followed by the exception message.
-
localizeMessage
public static String localizeMessage(String aResourceBundleName, String aMessageKey, Object[] aArguments, ClassLoader aLoader) Localize a message to the default Locale.- Parameters:
aResourceBundleName
- base name of resource bundleaMessageKey
- key of message to localizeaArguments
- arguments to message (may be null if none)aLoader
- ClassLoader to use to load the resource bundle. If null, the ClassLoader that loasedI18nUtil
is used.- Returns:
- localized message. If an exception occurs, returns "MESSAGE LOCALIZATION FAILED:" followed by the exception message.
-
localizeMessage
public static String localizeMessage(String aResourceBundleName, Locale aLocale, String aMessageKey, Object[] aArguments) Localize a message to a specified Locale.- Parameters:
aResourceBundleName
- base name of resource bundleaLocale
- locale to which to localizeaMessageKey
- key of message to localizeaArguments
- arguments to message (may be null if none)- Returns:
- localized message. If an exception occurs, returns "MESSAGE LOCALIZATION FAILED:" followed by the exception message.
-
localizeMessage
public static String localizeMessage(String aResourceBundleName, Locale aLocale, String aMessageKey, Object[] aArguments, ClassLoader aLoader) Localize a message to a specified Locale.- Parameters:
aResourceBundleName
- base name of resource bundleaLocale
- locale to which to localizeaMessageKey
- key of message to localizeaArguments
- arguments to message (may be null if none)aLoader
- ClassLoader to use to load the resource bundle. If null, the ClassLoader that loadedI18nUtil
is used.- Returns:
- localized message. If an exception occurs, returns "MESSAGE LOCALIZATION FAILED:" followed by the exception message.
-
localizeMessage
public static String localizeMessage(ResourceBundle aResourceBundle, Locale aLocale, String aMessageKey, Object[] aArguments) Localize a message to a specified Locale.- Parameters:
aResourceBundle
- the resource bundle to use to resolve message keysaLocale
- locale to which to localizeaMessageKey
- key of message to localizeaArguments
- arguments to message (may be null if none)- Returns:
- localized message. If an exception occurs, returns "MESSAGE LOCALIZATION FAILED:" followed by the exception message.
-
resolveResourceBundle
public static ResourceBundle resolveResourceBundle(String aResourceBundleName, Locale aLocale, ClassLoader aLoader) -
setTccl
-
removeTccl
public static void removeTccl()
-