--- a/src/java.base/share/classes/java/util/spi/LocaleNameProvider.java Tue Dec 12 09:33:37 2017 -0800
+++ b/src/java.base/share/classes/java/util/spi/LocaleNameProvider.java Tue Dec 12 10:21:58 2017 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
package java.util.spi;
import java.util.Locale;
+import java.util.Objects;
/**
* An abstract class for service providers that
@@ -141,4 +142,54 @@
* @see java.util.Locale#getDisplayVariant(java.util.Locale)
*/
public abstract String getDisplayVariant(String variant, Locale locale);
+
+ /**
+ * Returns a localized name for the given
+ * <a href="../Locale.html#def_locale_extension">Unicode extension</a> key,
+ * and the given locale that is appropriate for display to the user.
+ * If the name returned cannot be localized according to {@code locale},
+ * this method returns null.
+ * @implSpec the default implementation returns {@code null}.
+ * @param key the Unicode Extension key, not null.
+ * @param locale the desired locale, not null.
+ * @return the name of the given key string for the specified locale,
+ * or null if it's not available.
+ * @exception NullPointerException if {@code key} or {@code locale} is null
+ * @exception IllegalArgumentException if {@code locale} isn't
+ * one of the locales returned from
+ * {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
+ * getAvailableLocales()}.
+ * @since 10
+ */
+ public String getDisplayUnicodeExtensionKey(String key, Locale locale) {
+ Objects.requireNonNull(key);
+ Objects.requireNonNull(locale);
+ return null;
+ }
+
+ /**
+ * Returns a localized name for the given
+ * <a href="../Locale.html#def_locale_extension">Unicode extension</a> type,
+ * and the given locale that is appropriate for display to the user.
+ * If the name returned cannot be localized according to {@code locale},
+ * this method returns null.
+ * @implSpec the default implementation returns {@code null}.
+ * @param type the Unicode Extension type, not null.
+ * @param key the Unicode Extension key for this {@code type}, not null.
+ * @param locale the desired locale, not null.
+ * @return the name of the given type string for the specified locale,
+ * or null if it's not available.
+ * @exception NullPointerException if {@code key}, {@code type} or {@code locale} is null
+ * @exception IllegalArgumentException if {@code locale} isn't
+ * one of the locales returned from
+ * {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
+ * getAvailableLocales()}.
+ * @since 10
+ */
+ public String getDisplayUnicodeExtensionType(String type, String key, Locale locale) {
+ Objects.requireNonNull(type);
+ Objects.requireNonNull(key);
+ Objects.requireNonNull(locale);
+ return null;
+ }
}