BundleUtil
org.clapper.util.misc

Class BundleUtil



  • public final class BundleUtilextends Object
    ResourceBundle utilities to aid in localization.
    • Method Detail

      • getString

        public static String getString(String bundleName,               String key)
        Get a string from a bundle, using the default locale.
        Parameters:
        bundleName - the bundle name
        key - the key to look up
        Returns:
        the value for the key, or the default value
      • getString

        public static String getString(String bundleName,               String key,               String defaultMsg)
        Get a string from a bundle, using the default locale.
        Parameters:
        bundleName - the bundle name
        key - the key to look up
        defaultMsg - the default value, or null
        Returns:
        the value for the key, or the default value
      • getMessage

        public static String getMessage(String bundleName,                Locale locale,                String key,                String defaultMsg)
        Get a localized message from a bundle.
        Parameters:
        bundleName - the name of the resource bundle
        locale - the locale
        key - the key
        defaultMsg - the default message
        Returns:
        the message, or the default
      • getMessage

        public static String getMessage(String bundleName,                String key,                Object[] params)
        Get a message from the bundle using the default locale.
        Parameters:
        bundleName - the name of the resource bundle
        key - the key
        params - parameters for the message
        Returns:
        the message, or the default
      • getMessage

        public static String getMessage(String bundleName,                Locale locale,                String key,                String defaultMsg,                Object[] params)
        Get a localized message from the bundle.
        Parameters:
        bundleName - the name of the resource bundle
        locale - the locale
        key - the key
        defaultMsg - the default message
        params - parameters for the message
        Returns:
        the message, or the default
      • getMessage

        public static String getMessage(String bundleName,                Locale locale,                String key,                Object[] params)
        Get a localized message from the bundle.
        Parameters:
        bundleName - the name of the resource bundle
        locale - the locale
        key - the key
        params - parameters for the message
        Returns:
        the message, or the default

SCaVis 1.7 © jWork.org