2479 * </pre> 2480 * 2481 * @apiNote <a name="note">{@code ResourceBundle.Control} is not supported 2482 * in named modules.</a> If the {@code ResourceBundle.getBundle} method with 2483 * a {@code ResourceBundle.Control} is called in a named module, the method 2484 * will throw an {@link UnsupportedOperationException}. Any service providers 2485 * of {@link ResourceBundleControlProvider} are ignored in named modules. 2486 * 2487 * @since 1.6 2488 * @see java.util.spi.ResourceBundleProvider 2489 */ 2490 public static class Control { 2491 /** 2492 * The default format <code>List</code>, which contains the strings 2493 * <code>"java.class"</code> and <code>"java.properties"</code>, in 2494 * this order. This <code>List</code> is {@linkplain 2495 * Collections#unmodifiableList(List) unmodifiable}. 2496 * 2497 * @see #getFormats(String) 2498 */ 2499 public static final List<String> FORMAT_DEFAULT 2500 = Collections.unmodifiableList(Arrays.asList("java.class", 2501 "java.properties")); 2502 2503 /** 2504 * The class-only format <code>List</code> containing 2505 * <code>"java.class"</code>. This <code>List</code> is {@linkplain 2506 * Collections#unmodifiableList(List) unmodifiable}. 2507 * 2508 * @see #getFormats(String) 2509 */ 2510 public static final List<String> FORMAT_CLASS 2511 = Collections.unmodifiableList(Arrays.asList("java.class")); 2512 2513 /** 2514 * The properties-only format <code>List</code> containing 2515 * <code>"java.properties"</code>. This <code>List</code> is 2516 * {@linkplain Collections#unmodifiableList(List) unmodifiable}. 2517 * 2518 * @see #getFormats(String) 2519 */ 2520 public static final List<String> FORMAT_PROPERTIES 2521 = Collections.unmodifiableList(Arrays.asList("java.properties")); 2522 2523 /** 2524 * The time-to-live constant for not caching loaded resource bundle 2525 * instances. 2526 * 2527 * @see #getTimeToLive(String, Locale) 2528 */ 2529 public static final long TTL_DONT_CACHE = -1; 2530 2531 /** 2532 * The time-to-live constant for disabling the expiration control 2533 * for loaded resource bundle instances in the cache. 2534 * 2535 * @see #getTimeToLive(String, Locale) 2536 */ 2537 public static final long TTL_NO_EXPIRATION_CONTROL = -2; 2538 2539 private static final Control INSTANCE = new Control(); 2540 2541 /** | 2479 * </pre> 2480 * 2481 * @apiNote <a name="note">{@code ResourceBundle.Control} is not supported 2482 * in named modules.</a> If the {@code ResourceBundle.getBundle} method with 2483 * a {@code ResourceBundle.Control} is called in a named module, the method 2484 * will throw an {@link UnsupportedOperationException}. Any service providers 2485 * of {@link ResourceBundleControlProvider} are ignored in named modules. 2486 * 2487 * @since 1.6 2488 * @see java.util.spi.ResourceBundleProvider 2489 */ 2490 public static class Control { 2491 /** 2492 * The default format <code>List</code>, which contains the strings 2493 * <code>"java.class"</code> and <code>"java.properties"</code>, in 2494 * this order. This <code>List</code> is {@linkplain 2495 * Collections#unmodifiableList(List) unmodifiable}. 2496 * 2497 * @see #getFormats(String) 2498 */ 2499 public static final List<String> FORMAT_DEFAULT = List.of("java.class", "java.properties"); 2500 2501 /** 2502 * The class-only format <code>List</code> containing 2503 * <code>"java.class"</code>. This <code>List</code> is {@linkplain 2504 * Collections#unmodifiableList(List) unmodifiable}. 2505 * 2506 * @see #getFormats(String) 2507 */ 2508 public static final List<String> FORMAT_CLASS = List.of("java.class"); 2509 2510 /** 2511 * The properties-only format <code>List</code> containing 2512 * <code>"java.properties"</code>. This <code>List</code> is 2513 * {@linkplain Collections#unmodifiableList(List) unmodifiable}. 2514 * 2515 * @see #getFormats(String) 2516 */ 2517 public static final List<String> FORMAT_PROPERTIES = List.of("java.properties"); 2518 2519 /** 2520 * The time-to-live constant for not caching loaded resource bundle 2521 * instances. 2522 * 2523 * @see #getTimeToLive(String, Locale) 2524 */ 2525 public static final long TTL_DONT_CACHE = -1; 2526 2527 /** 2528 * The time-to-live constant for disabling the expiration control 2529 * for loaded resource bundle instances in the cache. 2530 * 2531 * @see #getTimeToLive(String, Locale) 2532 */ 2533 public static final long TTL_NO_EXPIRATION_CONTROL = -2; 2534 2535 private static final Control INSTANCE = new Control(); 2536 2537 /** |