Package de.aristaflow.adept2.util.i18n
Class Utf8ResourceBundleControl
- java.lang.Object
-
- java.util.ResourceBundle.Control
-
- de.aristaflow.adept2.util.i18n.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 combiningResourceBundle.Control
andResourceBundle.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 Summary
Fields Modifier and Type Field Description protected 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.protected boolean
noFallback
Deprecated, for removal: This API element is subject to removal in a future version.Whether to not fallback to the default locale.-
Fields inherited from class java.util.ResourceBundle.Control
FORMAT_CLASS, FORMAT_DEFAULT, FORMAT_PROPERTIES, TTL_DONT_CACHE, TTL_NO_EXPIRATION_CONTROL
-
-
Constructor Summary
Constructors Constructor Description 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(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.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(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.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Locale
getFallbackLocale(String baseName, Locale locale)
Deprecated, for removal: This API element is subject to removal in a future version.List<String>
getFormats(String baseName)
Deprecated, for removal: This API element is subject to removal in a future version.ResourceBundle
newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload)
Deprecated, for removal: This API element is subject to removal in a future version.-
Methods inherited from class java.util.ResourceBundle.Control
getCandidateLocales, getControl, getNoFallbackControl, getTimeToLive, needsReload, toBundleName, toResourceName
-
-
-
-
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.
-
-
Method Detail
-
getFormats
public List<String> getFormats(String baseName)
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
getFormats
in classResourceBundle.Control
-
getFallbackLocale
public Locale getFallbackLocale(String baseName, Locale locale)
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
getFallbackLocale
in classResourceBundle.Control
-
newBundle
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
newBundle
in classResourceBundle.Control
- Throws:
IllegalAccessException
InstantiationException
IOException
-
-