|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.portal.migration.model24.identity.LocaleInfo
Additional infos about a locale.
Nested Class Summary | |
private static class |
LocaleInfo.Infos
Hold the several ways to retrieve infos object. |
Field Summary | |
private static java.util.Comparator |
c
|
private java.util.Locale |
locale
The relaled locale. |
private static org.apache.log4j.Logger |
log
The logger. |
private LocaleInfo |
parent
The parent locale info or null if no parent. |
private static java.util.regex.Pattern |
RFC3066_COMPOUND_LANG_PATTERN
Valid language tag matcher (see IETF RFC 3066). |
private static java.lang.String |
RFC3066_SEPARATOR
Separator. |
private java.lang.String |
rfc3066LangageTag
The RFC3066 language tag. |
private static LocaleInfo.Infos |
sharedInfos
The locale info map. |
private static java.lang.String[] |
SORTED_ISO_COUNTRIES
Sorted valid ISO country codes (needed for Arrays.binarySearch). |
private static java.lang.String[] |
SORTED_ISO_LANGUAGES
Sorted valid ISO language codes (needed for Arrays.binarySearch). |
private java.lang.String |
trailingName
The trailing name used to compute resource bundle name. |
Constructor Summary | |
private |
LocaleInfo(LocaleInfo parent,
java.util.Locale locale)
|
Method Summary | |
static java.lang.String |
computeTrailingName(java.util.Locale locale)
Compute the trailing name for a given locale. |
private static LocaleInfo.Infos |
createFromAvailableLocales()
Create an infos object from the set of locales returned by Locale.getAvailableLocales() . |
static LocaleInfo |
decodeLocaleInfo(java.util.Locale locale)
Return the locale info for a specific locale. |
static LocaleInfo |
decodeLocaleInfo(java.lang.String code)
Return the locale info for a specific code. |
static LocaleInfo |
decodeLocaleInfoFromRFC3066LanguageTag(java.lang.String languageIdentificationTag)
Returns an info object based on the given language identification tag as defined by IETF RFC 3066 limited to 2-letter language code per ISO standard 639, a "-" (dash) and a 2-letter country code per ISO 3166 alpha-2 country codes. |
static java.util.Collection |
getAll()
Return a collection of all available locale info for the platform. |
private static LocaleInfo |
getInfo(java.util.Locale locale,
LocaleInfo.Infos infos)
Get an info object. |
java.util.Locale |
getLocale()
|
LocaleInfo |
getParent()
|
java.lang.String |
getRFC3066LanguageTag()
Retrieves the language identification tag associated to this LocaleInfo as defined by IETF RFC 3066 limited to 2-letter language code per ISO standard 639, a "-" (dash) and a 2-letter country code per ISO 3166 alpha-2 country codes. |
static java.lang.String |
getRFC3066LanguageTagFor(java.util.Locale locale)
Retrieves the language identification tag associated to the specified Locale as defined by IETF RFC 3066 limited to 2-letter language code per ISO standard 639, a "-" (dash) and a 2-letter country code per ISO 3166 alpha-2 country codes. |
java.lang.String |
getTrailingName()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static org.apache.log4j.Logger log
private static volatile LocaleInfo.Infos sharedInfos
private static final java.lang.String RFC3066_SEPARATOR
private static final java.util.regex.Pattern RFC3066_COMPOUND_LANG_PATTERN
private static final java.lang.String[] SORTED_ISO_COUNTRIES
private static final java.lang.String[] SORTED_ISO_LANGUAGES
private static final java.util.Comparator c
private LocaleInfo parent
private java.util.Locale locale
private java.lang.String trailingName
private java.lang.String rfc3066LangageTag
Constructor Detail |
private LocaleInfo(LocaleInfo parent, java.util.Locale locale)
Method Detail |
public LocaleInfo getParent()
public java.util.Locale getLocale()
public java.lang.String getTrailingName()
public java.lang.String getRFC3066LanguageTag()
java.lang.IllegalArgumentException
- if the given locale is not validpublic static java.lang.String getRFC3066LanguageTagFor(java.util.Locale locale)
locale
- the locale which language tag is wanted
java.lang.IllegalArgumentException
- if the given locale is not validpublic java.lang.String toString()
public static java.lang.String computeTrailingName(java.util.Locale locale) throws java.lang.IllegalArgumentException
locale
- the locale
java.lang.IllegalArgumentException
- if locale is nullprivate static LocaleInfo getInfo(java.util.Locale locale, LocaleInfo.Infos infos)
Get an info object.
Whenever the info object cannot be found then it creates a new one and possibly several since each info object may have a non null parent.
If the infos argument is null, then the static shared infos is used to perform a lookup. If the lookup returns null then the shared infos is cloned and updated with the newly created info objects. The operation performed is a copy on write and is thread safe. Note that concurrent updates may cause the lost of info object in the shared infos.
If the infos argument is not null, then it is used to perform a lookup first. If the lookup returns null then the infos object udpated with the newly created info objects. Note that no cloning of the infos object is performed.
locale
- the localeinfos
- the infos
private static LocaleInfo.Infos createFromAvailableLocales()
Locale.getAvailableLocales()
.
public static java.util.Collection getAll()
public static LocaleInfo decodeLocaleInfo(java.lang.String code) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the locale info is not found for the codepublic static LocaleInfo decodeLocaleInfo(java.util.Locale locale)
java.lang.IllegalArgumentException
- if the locale is not found for the codepublic static LocaleInfo decodeLocaleInfoFromRFC3066LanguageTag(java.lang.String languageIdentificationTag)
languageIdentificationTag
- the language tag to build the Locale from
java.lang.IllegalArgumentException
- if the given compound language is not a valid one or null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |