Class PropertyResourceBundleUtils

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_ENCODING
      The default encoding for PropertyResourceBundle
      static java.lang.String DEFAULT_ENCODING_PROPERTY_NAME
      The property name of encoding for PropertyResourceBundle
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.ResourceBundle getBundle​(java.lang.String baseName)
      ResourceBundle.getBundle(String, Locale) with default file encoding encoding and default Locale under Thread context ClassLoader
      static java.util.ResourceBundle getBundle​(java.lang.String baseName, java.lang.String encoding)
      ResourceBundle.getBundle(String, Locale) with specified encoding and default Locale under Thread context ClassLoader
      static java.util.ResourceBundle getBundle​(java.lang.String baseName, java.util.Locale locale, java.lang.ClassLoader classLoader, java.lang.String encoding)
      ResourceBundle.getBundle(String, Locale, ClassLoader) with specified encoding
      static java.util.ResourceBundle getBundle​(java.lang.String baseName, java.util.Locale locale, java.lang.String encoding)
      ResourceBundle.getBundle(String, Locale) with specified encoding under Thread context ClassLoader
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_ENCODING_PROPERTY_NAME

        public static final java.lang.String DEFAULT_ENCODING_PROPERTY_NAME
        The property name of encoding for PropertyResourceBundle
        See Also:
        Constant Field Values
      • DEFAULT_ENCODING

        public static final java.lang.String DEFAULT_ENCODING
        The default encoding for PropertyResourceBundle
    • Method Detail

      • getBundle

        public static java.util.ResourceBundle getBundle​(java.lang.String baseName)
        ResourceBundle.getBundle(String, Locale) with default file encoding encoding and default Locale under Thread context ClassLoader
        Parameters:
        baseName - the base name of the resource bundle, a fully qualified class name
        Returns:
        Throws:
        java.lang.NullPointerException - if baseName, locale, or loader is null
        java.util.MissingResourceException - if no resource bundle for the specified base name can be found
        java.lang.IllegalArgumentException - if the given control doesn't perform properly (e.g., control.getCandidateLocales returns null.) Note that validation of control is performed as needed.
      • getBundle

        public static java.util.ResourceBundle getBundle​(java.lang.String baseName,
                                                         java.lang.String encoding)
        ResourceBundle.getBundle(String, Locale) with specified encoding and default Locale under Thread context ClassLoader
        Parameters:
        baseName - the base name of the resource bundle, a fully qualified class name
        encoding - the control which gives information for the resource bundle loading process
        Returns:
        Throws:
        java.lang.NullPointerException - if baseName is null
        java.util.MissingResourceException - if no resource bundle for the specified base name can be found
        java.lang.IllegalArgumentException - if the given control doesn't perform properly (e.g., control.getCandidateLocales returns null.) Note that validation of control is performed as needed.
      • getBundle

        public static java.util.ResourceBundle getBundle​(java.lang.String baseName,
                                                         java.util.Locale locale,
                                                         java.lang.String encoding)
        ResourceBundle.getBundle(String, Locale) with specified encoding under Thread context ClassLoader
        Parameters:
        baseName - the base name of the resource bundle, a fully qualified class name
        locale - the locale for which a resource bundle is desired
        encoding - the control which gives information for the resource bundle loading process
        Returns:
        Throws:
        java.lang.NullPointerException - if baseName, locale is null
        java.util.MissingResourceException - if no resource bundle for the specified base name can be found
        java.lang.IllegalArgumentException - if the given control doesn't perform properly (e.g., control.getCandidateLocales returns null.) Note that validation of control is performed as needed.
      • getBundle

        public static java.util.ResourceBundle getBundle​(java.lang.String baseName,
                                                         java.util.Locale locale,
                                                         java.lang.ClassLoader classLoader,
                                                         java.lang.String encoding)
        ResourceBundle.getBundle(String, Locale, ClassLoader) with specified encoding
        Parameters:
        baseName - the base name of the resource bundle, a fully qualified class name
        locale - the locale for which a resource bundle is desired
        classLoader - the class loader from which to load the resource bundle
        encoding - the control which gives information for the resource bundle loading process
        Returns:
        Throws:
        java.lang.NullPointerException - if baseName, locale, or loader is null
        java.util.MissingResourceException - if no resource bundle for the specified base name can be found
        java.lang.IllegalArgumentException - if the given control doesn't perform properly (e.g., control.getCandidateLocales returns null.) Note that validation of control is performed as needed.