Class I18nUtil

java.lang.Object
org.apache.uima.internal.util.I18nUtil

public class I18nUtil extends Object
Internationaliation utilities. Static methods only
  • 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 bundle
      aMessageKey - key of message to localize
      aArguments - 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 bundle
      aMessageKey - key of message to localize
      aArguments - arguments to message (may be null if none)
      aLoader - ClassLoader to use to load the resource bundle. If null, the ClassLoader that loased I18nUtil 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 bundle
      aLocale - locale to which to localize
      aMessageKey - key of message to localize
      aArguments - 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 bundle
      aLocale - locale to which to localize
      aMessageKey - key of message to localize
      aArguments - arguments to message (may be null if none)
      aLoader - ClassLoader to use to load the resource bundle. If null, the ClassLoader that loaded I18nUtil 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 keys
      aLocale - locale to which to localize
      aMessageKey - key of message to localize
      aArguments - 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

      public static void setTccl(ClassLoader tccl)
    • removeTccl

      public static void removeTccl()