Package org.cyclos.impl.utils
Class CustomResourceBundleControl
- java.lang.Object
-
- java.util.ResourceBundle.Control
-
- org.cyclos.impl.utils.CustomResourceBundleControl
-
public class CustomResourceBundleControl extends ResourceBundle.Control
Custom resource bundle control used to read the .properties files as UTF-8 and don't fallback to the default Locale
-
-
Field Summary
-
Fields inherited from class java.util.ResourceBundle.Control
FORMAT_CLASS, FORMAT_DEFAULT, FORMAT_PROPERTIES, TTL_DONT_CACHE, TTL_NO_EXPIRATION_CONTROL
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalegetFallbackLocale(String baseName, Locale locale)List<String>getFormats(String baseName)static CustomResourceBundleControlgetInstance(boolean disableCache)longgetTimeToLive(String baseName, Locale locale)booleanneedsReload(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime)ResourceBundlenewBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload)-
Methods inherited from class java.util.ResourceBundle.Control
getCandidateLocales, getControl, getNoFallbackControl, toBundleName, toResourceName
-
-
-
-
Method Detail
-
getInstance
public static CustomResourceBundleControl getInstance(boolean disableCache)
-
getFallbackLocale
public Locale getFallbackLocale(String baseName, Locale locale)
- Overrides:
getFallbackLocalein classResourceBundle.Control
-
getFormats
public List<String> getFormats(String baseName)
- Overrides:
getFormatsin classResourceBundle.Control
-
getTimeToLive
public long getTimeToLive(String baseName, Locale locale)
- Overrides:
getTimeToLivein classResourceBundle.Control
-
needsReload
public boolean needsReload(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime)
- Overrides:
needsReloadin classResourceBundle.Control
-
newBundle
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException
- Overrides:
newBundlein classResourceBundle.Control- Throws:
IllegalAccessExceptionInstantiationExceptionIOException
-
-