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 combining
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 Summary
FieldsModifier and TypeFieldDescriptionDeprecated, for removal: This API element is subject to removal in a future version.The formats of the resource bundles to be used.protected final booleanDeprecated, 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
ConstructorsConstructorDescriptionDeprecated, 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
Modifier and TypeMethodDescriptiongetFallbackLocale(String baseName, Locale locale) Deprecated, for removal: This API element is subject to removal in a future version.getFormats(String baseName) Deprecated, for removal: This API element is subject to removal in a future version.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 Details
-
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 noFallbackDeprecated, for removal: This API element is subject to removal in a future version.Whether to not fallback to the default locale.
-
-
Constructor Details
-
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
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
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 Details
-
getFormats
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
getFormatsin classResourceBundle.Control
-
getFallbackLocale
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
getFallbackLocalein 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:
newBundlein classResourceBundle.Control- Throws:
IllegalAccessExceptionInstantiationExceptionIOException
-