[loc-en-dev] getLocaleKeywordKeys/getLocaleKeywordValue
Yoshito Umaoka
y.umaoka at gmail.com
Thu Mar 12 09:04:24 PDT 2009
In the API review conference call on Tuesday, we agreed that the term
"LocaleKeywordXXX" and "Unicode Locale Identifier" might not be
appropriate. I'm going to update the name of these APIs:
Locale#getLocaleKeywordValue -> getLDMLType
Locale#getLocaleKeywordKeys -> getLDMLKeys
Builder#setLocaleKeyword -> setLDMLKeyword
I'll also add a static definition for LDML extension letter as
LDML_EXTENSION_KEY ('u')
I attached the new JavaDoc comments and API signature at the end of
this message. If you have any problems with the new names, please
respond to the ML.
-Yoshito
/**
* <span style="background-color: #00ccff; font-weight: bold">New
* API</span> Returns the LDML keyword type value associated with
* the specified LDML key for this locale. LDML keywords are specified
* by the 'u' extension and consist of key/type pairs. The key must be
* two alphanumeric characters in length, or an IllegalArgumentException
* is thrown.
* @param key the LDML key
* @return the value ('type') associated with the key, or null if the
* locale does not define a value for the key.
* @throws IllegalArgumentException if the key is not valid.
* @since 1.7
*/
public String getLDMLType(String key)
/**
* <span style="background-color: #00ccff; font-weight: bold">New
API</span>
* Returns the set of keys for LDML keywords defined by this locale, or
* null if this locale has no locale extension. The returned set is
* immutable.
* @return The set of the LDML keys, or null
* @since 1.7
*/
public Set<String> getLDMLKeys()
/**
* <span style="background-color: #00ccff; font-weight:
bold">New API</span>
* Sets the Unicode locale type for the given key. If the
* type is the empty string, the locale key is removed.
* Well-formed keys are strings of two alphanumeric characters.
Well-formed
* types are strings of three to eight alphanumeric characters.
* <p>
* <b>Note</b>:Setting the 'u' extension replaces all LDML
* keywords with those defined in the extension.
* @param key the key
* @param type the Unicode locale type
* @return this builder
* @throws IllegalArgumentException if <code>key</code> or
<code>type</code>
* is ill-formed
* @see #setExtension(char, String)
* @since 1.7
*/
public Builder setLDMLKeyword(String key, String type)
/**
* <span style="background-color: #00ccff; font-weight: bold">New
API</span>
* The key for LDML extension.
* @see #getExtension(char)
* @see Builder#setExtension(char, String)
* @since 1.7
*/
static public final char LDML_EXTENSION_KEY = 'u';
More information about the locale-enhancement-dev
mailing list