mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8176841: Additional Unicode Language-Tag Extensions
8189134: New system properties for the default Locale extensions 8190918: Retrieve the region specific data regardless of language in locale 8191349: Add a new method in j.t.f.DateTimeFormatter to reflect Unicode extensions Reviewed-by: scolebourne, lancea, rriggs, rgoel, nishjain
This commit is contained in:
parent
3246c46f41
commit
f065141ddc
55 changed files with 3631 additions and 890 deletions
|
@ -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 @@ public abstract class LocaleNameProvider extends LocaleServiceProvider {
|
|||
* @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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue