Package com.ibm.icu.impl
Class LocaleIDParser
- java.lang.Object
-
- com.ibm.icu.impl.LocaleIDParser
-
public final class LocaleIDParser extends Object
Utility class to parse and normalize locale ids (including POSIX style)
-
-
Constructor Summary
Constructors Constructor Description LocaleIDParser(String localeID)LocaleIDParser(String localeID, boolean canonicalize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefaultKeywordValue(String keywordName, String value)Set the keyword value only if it is not already set to something else.StringgetBaseName()Returns the normalized base form of the locale id.StringgetCountry()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.StringgetKeywordValue(String keywordName)Returns the value for the named keyword, or null if the keyword is not present.StringgetLanguage()Returns the normalized language id, or the empty string.String[]getLanguageScriptCountryVariant()Returns the language, script, country, and variant as separate strings.StringgetName()Returns the normalized full form of the locale id.StringgetScript()Returns the normalized script id, or the empty string.StringgetVariant()Returns the normalized variant id, or the empty string.voidparseBaseName()voidsetBaseName(String baseName)voidsetKeywordValue(String keywordName, String value)Set the value for the named keyword, or unset it if value is null.
-
-
-
Method Detail
-
getLanguage
public String getLanguage()
Returns the normalized language id, or the empty string.
-
getScript
public String getScript()
Returns the normalized script id, or the empty string.
-
getCountry
public String getCountry()
return the normalized country id, or the empty string.
-
getVariant
public String getVariant()
Returns the normalized variant id, or the empty string.
-
getLanguageScriptCountryVariant
public String[] getLanguageScriptCountryVariant()
Returns the language, script, country, and variant as separate strings.
-
setBaseName
public void setBaseName(String baseName)
-
parseBaseName
public void parseBaseName()
-
getBaseName
public String getBaseName()
Returns the normalized base form of the locale id. The base form does not include keywords.
-
getName
public String getName()
Returns the normalized full form of the locale id. The full form includes keywords if they are present.
-
getKeywordMap
public Map<String,String> getKeywordMap()
Returns a map of the keywords and values, or null if there are none.
-
getKeywords
public Iterator<String> getKeywords()
Returns an iterator over the keywords, or null if we have an empty map.
-
getKeywordValue
public String getKeywordValue(String keywordName)
Returns the value for the named keyword, or null if the keyword is not present.
-
defaultKeywordValue
public void defaultKeywordValue(String keywordName, String value)
Set the keyword value only if it is not already set to something else.
-
-