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. Use INSTANCE
as the control parameter
when calling ResourceBundle.getBundle(String, java.util.ResourceBundle.Control)
.
- Since:
- 2.16
- Author:
- Nicklas
- Last modified
- $Date: 2010-09-16 13:32:06 +0200 (Thu, 16 Sep 2010) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final Utf8PropertiesResourceBundleControl INSTANCE
- The one and only instance.
Utf8PropertiesResourceBundleControl
private Utf8PropertiesResourceBundleControl()
getFallbackLocale
public Locale getFallbackLocale(String baseName,
Locale locale)
- We don't need a fallback locale.
- Overrides:
getFallbackLocale
in class ResourceBundle.Control
- Returns:
- Always null
getFormats
public List<String> getFormats(String baseName)
- This control only handle property files.
- Overrides:
getFormats
in class ResourceBundle.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 class ResourceBundle.Control
- Throws:
IllegalAccessException
InstantiationException
IOException