public final class LocaleIDParser extends Object
| Constructor and Description |
|---|
LocaleIDParser(String localeID) |
LocaleIDParser(String localeID,
boolean canonicalize) |
| Modifier and Type | Method and Description |
|---|---|
void |
defaultKeywordValue(String keywordName,
String value)
Set the keyword value only if it is not already set to something else.
|
String |
getBaseName()
Returns the normalized base form of the locale id.
|
String |
getCountry()
return the normalized country id, or the empty string.
|
Map<String,String> |
getKeywordMap()
Returns a map of the keywords and values, or null if there are none.
|
Iterator<String> |
getKeywords()
Returns an iterator over the keywords, or null if we have an empty map.
|
String |
getKeywordValue(String keywordName)
Returns the value for the named keyword, or null if the keyword is not
present.
|
String |
getLanguage()
Returns the normalized language id, or the empty string.
|
String[] |
getLanguageScriptCountryVariant()
Returns the language, script, country, and variant as separate strings.
|
String |
getName()
Returns the normalized full form of the locale id.
|
String |
getScript()
Returns the normalized script id, or the empty string.
|
String |
getVariant()
Returns the normalized variant id, or the empty string.
|
void |
parseBaseName() |
void |
setBaseName(String baseName) |
void |
setKeywordValue(String keywordName,
String value)
Set the value for the named keyword, or unset it if value is null.
|
public LocaleIDParser(String localeID)
public LocaleIDParser(String localeID, boolean canonicalize)
public String getLanguage()
public String getScript()
public String getCountry()
public String getVariant()
public String[] getLanguageScriptCountryVariant()
public void setBaseName(String baseName)
public void parseBaseName()
public String getBaseName()
public String getName()
public Map<String,String> getKeywordMap()
public Iterator<String> getKeywords()
public String getKeywordValue(String keywordName)
public void defaultKeywordValue(String keywordName, String value)