📅  最后修改于: 2020-11-14 06:22:49             🧑  作者: Mango
java.util.ResourceBundle.Control类与工厂方法协作以加载资源束。以下是ResourceBundle.Control的重点-
如果多个线程同时使用该类实例,则该实例必须是线程安全的。
以下是java.util.ResourceBundle.Control类的声明-
public static class ResourceBundle.Control
extends Object
以下是java.util.ResourceBundle.Control类的字段-
static int STANDARD_TIME-这是指定为标准时间的开始或结束时间模式的常数。
静态List
静态List
静态List
静态长TTL_DONT_CACHE-这是不缓存加载的资源包实例的生存时间常数。
静态长TTL_NO_EXPIRATION_CONTROL-这是生存时间常数,用于为缓存中已加载的资源包实例禁用过期控制。
Sr.No. | Constructor & Description |
---|---|
1 |
List This is the single constructor. |
Sr.No. | Method & Description |
---|---|
1 | List This method returns a List of Locales as candidate locales for baseName and locale. |
2 | static ResourceBundle.Control getControl(List This method returns a ResourceBundle.Control in which the getFormats method returns the specified formats. |
3 | Locale getFallbackLocale(String baseName, Locale locale)
This method returns a Locale to be used as a fallback locale for further resource bundle searches by the ResourceBundle.getBundle factory method. |
4 | List This method returns a list of strings containing formats to be used to load resource bundles for the given baseName. |
5 | static ResourceBundle.Control getNoFallbackControl(List This method returns a ResourceBundle.Control in which the getFormats method returns the specified formats and the getFallbackLocale method returns null. |
6 | long getTimeToLive(String baseName, Locale locale)
This method returns the time-to-live (TTL) value for resource bundles that are loaded under this ResourceBundle.Control. |
7 | boolean needsReload(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime)
This method determines if the expired bundle in the cache needs to be reloaded based on the loading time given by loadTime or some other criteria. |
8 | ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload)
This method instantiates a resource bundle for the given bundle name of the given format and locale, using the given class loader if necessary. |
9 | String toBundleName(String baseName, Locale locale)
This method converts the given baseName and locale to the bundle name. |
10 | String toResourceName(String bundleName, String suffix)
This method converts the given bundleName to the form required by the ClassLoader.getResource method by replacing all occurrences of ‘.’ in bundleName with ‘/’ and appending a ‘.’ and the given file suffix. |
此类从以下类继承方法-