src/java.base/share/classes/java/util/spi/LocaleNameProvider.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58288 48e480e56aad
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
58242
94bb65cb37d3 8230648: Replace @exception tag with @throws in java.base
jboes
parents: 48251
diff changeset
     2
 * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.util.spi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.Locale;
48251
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
    29
import java.util.Objects;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * An abstract class for service providers that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * provide localized names for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * {@link java.util.Locale Locale} class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * @since        1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
public abstract class LocaleNameProvider extends LocaleServiceProvider {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
     * Sole constructor.  (For invocation by subclass constructors, typically
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     * implicit.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    protected LocaleNameProvider() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    /**
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    48
     * Returns a localized name for the given <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    49
     * IETF BCP47</a> language code and the given locale that is appropriate for
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    50
     * display to the user.
58288
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    51
     * For example, if {@code languageCode} is "fr" and {@code locale}
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    52
     * is en_US, getDisplayLanguage() will return "French"; if {@code languageCode}
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    53
     * is "en" and {@code locale} is fr_FR, getDisplayLanguage() will return "anglais".
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    54
     * If the name returned cannot be localized according to {@code locale},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * (say, the provider does not have a Japanese name for Croatian),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * this method returns null.
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    57
     * @param languageCode the language code string in the form of two to eight
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *     lower-case letters between 'a' (U+0061) and 'z' (U+007A)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * @param locale the desired locale
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @return the name of the given language code for the specified locale, or null if it's not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     *     available.
58288
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    62
     * @throws    NullPointerException if {@code languageCode} or {@code locale} is null
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    63
     * @throws    IllegalArgumentException if {@code languageCode} is not in the form of
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    64
     *     two or three lower-case letters, or {@code locale} isn't
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     *     one of the locales returned from
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     *     getAvailableLocales()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * @see java.util.Locale#getDisplayLanguage(java.util.Locale)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public abstract String getDisplayLanguage(String languageCode, Locale locale);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    /**
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    73
     * Returns a localized name for the given <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    74
     * IETF BCP47</a> script code and the given locale that is appropriate for
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    75
     * display to the user.
58288
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    76
     * For example, if {@code scriptCode} is "Latn" and {@code locale}
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    77
     * is en_US, getDisplayScript() will return "Latin"; if {@code scriptCode}
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    78
     * is "Cyrl" and {@code locale} is fr_FR, getDisplayScript() will return "cyrillique".
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    79
     * If the name returned cannot be localized according to {@code locale},
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    80
     * (say, the provider does not have a Japanese name for Cyrillic),
8146
f1b64e82649f 7013282: No appropriate CCC request for listed JDK 7 changes in java.util.spi package (b121)
naoto
parents: 7252
diff changeset
    81
     * this method returns null. The default implementation returns null.
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    82
     * @param scriptCode the four letter script code string in the form of title-case
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    83
     *     letters (the first letter is upper-case character between 'A' (U+0041) and
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    84
     *     'Z' (U+005A) followed by three lower-case character between 'a' (U+0061)
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    85
     *     and 'z' (U+007A)).
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    86
     * @param locale the desired locale
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    87
     * @return the name of the given script code for the specified locale, or null if it's not
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    88
     *     available.
58288
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    89
     * @throws    NullPointerException if {@code scriptCode} or {@code locale} is null
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    90
     * @throws    IllegalArgumentException if {@code scriptCode} is not in the form of
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
    91
     *     four title case letters, or {@code locale} isn't
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    92
     *     one of the locales returned from
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    93
     *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    94
     *     getAvailableLocales()}.
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    95
     * @see java.util.Locale#getDisplayScript(java.util.Locale)
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    96
     * @since 1.7
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
    97
     */
7252
2316b2e837d8 7000136: Backward compatibility problem in LocaleNameProvider
naoto
parents: 6501
diff changeset
    98
    public String getDisplayScript(String scriptCode, Locale locale) {
2316b2e837d8 7000136: Backward compatibility problem in LocaleNameProvider
naoto
parents: 6501
diff changeset
    99
        return null;
2316b2e837d8 7000136: Backward compatibility problem in LocaleNameProvider
naoto
parents: 6501
diff changeset
   100
    }
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
   101
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
   102
    /**
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
   103
     * Returns a localized name for the given <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
   104
     * IETF BCP47</a> region code (either ISO 3166 country code or UN M.49 area
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
   105
     * codes) and the given locale that is appropriate for display to the user.
58288
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   106
     * For example, if {@code countryCode} is "FR" and {@code locale}
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   107
     * is en_US, getDisplayCountry() will return "France"; if {@code countryCode}
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   108
     * is "US" and {@code locale} is fr_FR, getDisplayCountry() will return "Etats-Unis".
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   109
     * If the name returned cannot be localized according to {@code locale},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * (say, the provider does not have a Japanese name for Croatia),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * this method returns null.
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
   112
     * @param countryCode the country(region) code string in the form of two
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
   113
     *     upper-case letters between 'A' (U+0041) and 'Z' (U+005A) or the UN M.49 area code
684810d882b3 6875847: Java Locale Enhancement
naoto
parents: 5506
diff changeset
   114
     *     in the form of three digit letters between '0' (U+0030) and '9' (U+0039).
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * @param locale the desired locale
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * @return the name of the given country code for the specified locale, or null if it's not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     *     available.
58288
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   118
     * @throws    NullPointerException if {@code countryCode} or {@code locale} is null
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   119
     * @throws    IllegalArgumentException if {@code countryCode} is not in the form of
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   120
     *     two upper-case letters or three digit letters, or {@code locale} isn't
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     *     one of the locales returned from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     *     getAvailableLocales()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * @see java.util.Locale#getDisplayCountry(java.util.Locale)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    public abstract String getDisplayCountry(String countryCode, Locale locale);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * Returns a localized name for the given variant code and the given locale that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * is appropriate for display to the user.
58288
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   131
     * If the name returned cannot be localized according to {@code locale},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * this method returns null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @param variant the variant string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @param locale the desired locale
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * @return the name of the given variant string for the specified locale, or null if it's not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *     available.
58288
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   137
     * @throws    NullPointerException if {@code variant} or {@code locale} is null
48e480e56aad 8231186: Replace html tag <code>foo</code> with javadoc tag {@code foo} in java.base
jboes
parents: 58242
diff changeset
   138
     * @throws    IllegalArgumentException if {@code locale} isn't
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     *     one of the locales returned from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     *     getAvailableLocales()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @see java.util.Locale#getDisplayVariant(java.util.Locale)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    public abstract String getDisplayVariant(String variant, Locale locale);
48251
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   145
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   146
    /**
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   147
     * Returns a localized name for the given
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   148
     * <a href="../Locale.html#def_locale_extension">Unicode extension</a> key,
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   149
     * and the given locale that is appropriate for display to the user.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   150
     * If the name returned cannot be localized according to {@code locale},
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   151
     * this method returns null.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   152
     * @implSpec the default implementation returns {@code null}.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   153
     * @param key the Unicode Extension key, not null.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   154
     * @param locale the desired locale, not null.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   155
     * @return the name of the given key string for the specified locale,
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   156
     *  or null if it's not available.
58242
94bb65cb37d3 8230648: Replace @exception tag with @throws in java.base
jboes
parents: 48251
diff changeset
   157
     * @throws    NullPointerException if {@code key} or {@code locale} is null
94bb65cb37d3 8230648: Replace @exception tag with @throws in java.base
jboes
parents: 48251
diff changeset
   158
     * @throws    IllegalArgumentException if {@code locale} isn't
48251
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   159
     *     one of the locales returned from
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   160
     *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   161
     *     getAvailableLocales()}.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   162
     * @since 10
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   163
     */
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   164
    public String getDisplayUnicodeExtensionKey(String key, Locale locale) {
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   165
        Objects.requireNonNull(key);
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   166
        Objects.requireNonNull(locale);
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   167
        return null;
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   168
    }
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   169
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   170
    /**
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   171
     * Returns a localized name for the given
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   172
     * <a href="../Locale.html#def_locale_extension">Unicode extension</a> type,
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   173
     * and the given locale that is appropriate for display to the user.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   174
     * If the name returned cannot be localized according to {@code locale},
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   175
     * this method returns null.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   176
     * @implSpec the default implementation returns {@code null}.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   177
     * @param type the Unicode Extension type, not null.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   178
     * @param key the Unicode Extension key for this {@code type}, not null.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   179
     * @param locale the desired locale, not null.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   180
     * @return the name of the given type string for the specified locale,
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   181
     *  or null if it's not available.
58242
94bb65cb37d3 8230648: Replace @exception tag with @throws in java.base
jboes
parents: 48251
diff changeset
   182
     * @throws    NullPointerException if {@code key}, {@code type} or {@code locale} is null
94bb65cb37d3 8230648: Replace @exception tag with @throws in java.base
jboes
parents: 48251
diff changeset
   183
     * @throws    IllegalArgumentException if {@code locale} isn't
48251
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   184
     *     one of the locales returned from
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   185
     *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   186
     *     getAvailableLocales()}.
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   187
     * @since 10
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   188
     */
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   189
    public String getDisplayUnicodeExtensionType(String type, String key, Locale locale) {
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   190
        Objects.requireNonNull(type);
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   191
        Objects.requireNonNull(key);
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   192
        Objects.requireNonNull(locale);
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   193
        return null;
57148c79bd75 8176841: Additional Unicode Language-Tag Extensions
naoto
parents: 47216
diff changeset
   194
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
}