站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.4 API 英文版文档

LocaleInfo - JBOSS Portal 2.4 API 英文版文档


org.jboss.portal.migration.model24.identity
Class LocaleInfo

java.lang.Object
  extended byorg.jboss.portal.migration.model24.identity.LocaleInfo

public final class LocaleInfo
extends java.lang.Object

Additional infos about a locale.


Method Summary
static java.lang.String computeTrailingName(java.util.Locale locale)
          Compute the trailing name for a given locale.
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.
 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
 

Method Detail

getParent

public LocaleInfo getParent()

getLocale

public java.util.Locale getLocale()

getTrailingName

public java.lang.String getTrailingName()

getRFC3066LanguageTag

public 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. E.g. "en-US" for American English, "en-GB" for British English, etc.

Returns:
a IETF RFC 3066-compatible language tag.
Throws:
java.lang.IllegalArgumentException - if the given locale is not valid
Since:
2.4

getRFC3066LanguageTagFor

public 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. E.g. "en-US" for American English, "en-GB" for British English, etc.

Parameters:
locale - the locale which language tag is wanted
Returns:
a IETF RFC 3066-compatible language tag.
Throws:
java.lang.IllegalArgumentException - if the given locale is not valid
Since:
2.4

toString

public java.lang.String toString()

computeTrailingName

public static java.lang.String computeTrailingName(java.util.Locale locale)
                                            throws java.lang.IllegalArgumentException
Compute the trailing name for a given locale.

Parameters:
locale - the locale
Returns:
the trailing name
Throws:
java.lang.IllegalArgumentException - if locale is null

getAll

public static java.util.Collection getAll()
Return a collection of all available locale info for the platform.


decodeLocaleInfo

public static LocaleInfo decodeLocaleInfo(java.lang.String code)
                                   throws java.lang.IllegalArgumentException
Return the locale info for a specific code.

Throws:
java.lang.IllegalArgumentException - if the locale info is not found for the code

decodeLocaleInfo

public static LocaleInfo decodeLocaleInfo(java.util.Locale locale)
Return the locale info for a specific locale.

Throws:
java.lang.IllegalArgumentException - if the locale is not found for the code

decodeLocaleInfoFromRFC3066LanguageTag

public 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. E.g. "en-US" for American English, "en-GB" for British English, etc.

Parameters:
languageIdentificationTag - the language tag to build the Locale from
Returns:
a LocaleInfo associated to the given compound language tag
Throws:
java.lang.IllegalArgumentException - if the given compound language is not a valid one or null
Since:
2.4