Package net.sf.basedb.util.resources
Class Utf8PropertiesResourceBundleControl
java.lang.Object
java.util.ResourceBundle.Control
net.sf.basedb.util.resources.Utf8PropertiesResourceBundleControl
ResourceBundle.Control implementation that open property files in UTF-8 format
instead of ISO-8859-1 format. Use
INSTANCE
as the control parameter
when calling ResourceBundle.getBundle(String, java.util.ResourceBundle.Control)
.- Since:
- 2.16
- Author:
- Nicklas
- Last modified
- $Date: 2019-05-21 13:37:09 +0200 (tis, 21 maj 2019) $
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Utf8PropertiesResourceBundleControl
The one and only instance.Fields inherited from class java.util.ResourceBundle.Control
FORMAT_CLASS, FORMAT_DEFAULT, FORMAT_PROPERTIES, TTL_DONT_CACHE, TTL_NO_EXPIRATION_CONTROL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFallbackLocale
(String baseName, Locale locale) We don't need a fallback locale.getFormats
(String baseName) This control only handle property files.newBundle
(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) Load property files using UTF-8.Methods inherited from class java.util.ResourceBundle.Control
getCandidateLocales, getControl, getNoFallbackControl, getTimeToLive, needsReload, toBundleName, toResourceName
-
Field Details
-
INSTANCE
The one and only instance.
-
-
Constructor Details
-
Utf8PropertiesResourceBundleControl
private Utf8PropertiesResourceBundleControl()
-
-
Method Details
-
getFallbackLocale
We don't need a fallback locale.- Overrides:
getFallbackLocale
in classResourceBundle.Control
- Returns:
- Always null
-
getFormats
This control only handle property files.- Overrides:
getFormats
in classResourceBundle.Control
- Returns:
- Always
ResourceBundle.Control.FORMAT_PROPERTIES
.
-
newBundle
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException Load property files using UTF-8.- Overrides:
newBundle
in classResourceBundle.Control
- Throws:
IllegalAccessException
InstantiationException
IOException
-