Package net.sf.basedb.util.resources
Class Utf8PropertiesResourceBundleControl
- java.lang.Object
-
- java.util.ResourceBundle.Control
-
- net.sf.basedb.util.resources.Utf8PropertiesResourceBundleControl
-
public class Utf8PropertiesResourceBundleControl extends ResourceBundle.Control
ResourceBundle.Control implementation that open property files in UTF-8 format instead of ISO-8859-1 format. UseINSTANCE
as the control parameter when callingResourceBundle.getBundle(String, java.util.ResourceBundle.Control)
.- Since:
- 2.16
- Author:
- Nicklas
- Last modified
- $Date: 2011-10-24 15:02:46 +0200 (må, 24 okt 2011) $
-
-
Field Summary
Fields Modifier and Type Field Description static Utf8PropertiesResourceBundleControl
INSTANCE
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
Constructors Modifier Constructor Description private
Utf8PropertiesResourceBundleControl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Locale
getFallbackLocale(String baseName, Locale locale)
We don't need a fallback locale.List<String>
getFormats(String baseName)
This control only handle property files.ResourceBundle
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 Detail
-
INSTANCE
public static final Utf8PropertiesResourceBundleControl INSTANCE
The one and only instance.
-
-
Method Detail
-
getFallbackLocale
public Locale getFallbackLocale(String baseName, Locale locale)
We don't need a fallback locale.- Overrides:
getFallbackLocale
in classResourceBundle.Control
- Returns:
- Always null
-
getFormats
public List<String> getFormats(String baseName)
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
-
-