Class Utf8ResourceBundleControl


  • @Deprecated(since="11.0.0",
                forRemoval=true)
    public class Utf8ResourceBundleControl
    extends ResourceBundle.Control
    Deprecated, for removal: This API element is subject to removal in a future version.
    The minimum Java version is Java 11, there is no need for this class any more since all ResourceBundles are UTF-8-encoded.
    This control loads a resource bundle with UTF-8. This is only required for Java < 9 since these JVMs use ISO-8859-1 as encoding for resource bundles. Java 9 changed this to UTF-8.
    Optionally, this bundle control allows to prevent falling back to the default locale of the JVM thus combining ResourceBundle.Control and ResourceBundle.NoFallbackControl.NO_FALLBACK. It also allows to define the resource bundle formats to be used.

    Due to the restrictive visibility and static methods, most of the content of this class has been copied from the superclass.

    Only use this control if you are using Java 8!. Since code has been copied, this class may not be up-to-date to the latest JVMs.

    • Field Detail

      • formats

        protected final List<String> formats
        Deprecated, for removal: This API element is subject to removal in a future version.
        The formats of the resource bundles to be used.
      • noFallback

        protected final boolean noFallback
        Deprecated, for removal: This API element is subject to removal in a future version.
        Whether to not fallback to the default locale.
    • Constructor Detail

      • Utf8ResourceBundleControl

        public Utf8ResourceBundleControl()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a new bundle control reading a resource bundle with UTF-8 falling back to the default locale of the JVM.
      • Utf8ResourceBundleControl

        public Utf8ResourceBundleControl​(boolean noFallback)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a new bundle control reading a resource bundle with UTF-8.
        Parameters:
        noFallback - Whether to not fallback to the default locale.
      • Utf8ResourceBundleControl

        public Utf8ResourceBundleControl​(List<String> formats)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a new bundle control reading a resource bundle with UTF-8 falling back to the default locale of the JVM.
      • Utf8ResourceBundleControl

        public Utf8ResourceBundleControl​(List<String> formats,
                                         boolean noFallback)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a new bundle control reading a resource bundle with UTF-8.
        Parameters:
        noFallback - Whether to not fallback to the default locale.
        formats - The formats of the resource bundles to be used.