2474 * } 2475 * public Enumeration<String> getKeys() { 2476 * ... 2477 * } 2478 * } 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 /** | 2474 * } 2475 * public Enumeration<String> getKeys() { 2476 * ... 2477 * } 2478 * } 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 unmodifiable. 2495 * 2496 * @see #getFormats(String) 2497 */ 2498 public static final List<String> FORMAT_DEFAULT 2499 = 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 unmodifiable. 2504 * 2505 * @see #getFormats(String) 2506 */ 2507 public static final List<String> FORMAT_CLASS = List.of("java.class"); 2508 2509 /** 2510 * The properties-only format <code>List</code> containing 2511 * <code>"java.properties"</code>. This <code>List</code> is unmodifiable. 2512 * 2513 * @see #getFormats(String) 2514 */ 2515 public static final List<String> FORMAT_PROPERTIES 2516 = List.of("java.properties"); 2517 2518 /** 2519 * The time-to-live constant for not caching loaded resource bundle 2520 * instances. 2521 * 2522 * @see #getTimeToLive(String, Locale) 2523 */ 2524 public static final long TTL_DONT_CACHE = -1; 2525 2526 /** 2527 * The time-to-live constant for disabling the expiration control 2528 * for loaded resource bundle instances in the cache. 2529 * 2530 * @see #getTimeToLive(String, Locale) 2531 */ 2532 public static final long TTL_NO_EXPIRATION_CONTROL = -2; 2533 2534 private static final Control INSTANCE = new Control(); 2535 2536 /** |