|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.i18n.LocaleManager
Manages locales on behalf of a user.
This class currently keeps track of locales at the following levels:
Constructor Summary | |
LocaleManager(IPerson person)
Constructor that associates a locale manager with a user. |
|
LocaleManager(IPerson person,
java.lang.String acceptLanguage)
Constructor that sets up locales according to the Accept-Language request header
from a user's browser. |
Method Summary | |
java.util.Locale[] |
getBrowserLocales()
|
static java.util.Locale |
getJvmLocale()
|
java.util.Locale[] |
getLocales()
Produces a sorted list of locales according to locale preferences obtained from several places. |
static java.util.Locale[] |
getPortalLocales()
|
java.util.Locale[] |
getSessionLocales()
|
java.util.Locale[] |
getUserLocales()
|
static boolean |
isLocaleAware()
|
static java.util.Locale |
parseLocale(java.lang.String localeString)
Helper method to produce a java.util.Locale object from
a locale string such as en_US or ja_JP. |
static java.util.Locale[] |
parseLocales(java.lang.String localeStringList)
Helper method to produce a java.util.Locale array from
a comma-delimited locale string list, e.g. |
void |
persistUserLocales(java.util.Locale[] userLocales)
Stores the user locales persistantly. |
void |
setBrowserLocales(java.util.Locale[] browserLocales)
|
static void |
setJvmLocale(java.util.Locale jvmLocale)
|
static void |
setPortalLocales(java.util.Locale[] portalLocales)
|
void |
setSessionLocales(java.util.Locale[] sessionLocales)
|
void |
setUserLocales(java.util.Locale[] userLocales)
|
static java.lang.String |
stringValueOf(java.util.Locale[] locales)
Constructs a comma-delimited list of locales that could be parsed back into a Locale array with parseLocales(String localeStringList). |
java.lang.String |
toString()
|
static org.w3c.dom.Document |
xmlValueOf(java.util.Locale[] locales)
Creates an XML representation of a list of locales. |
static org.w3c.dom.Document |
xmlValueOf(java.util.Locale[] locales,
java.util.Locale selectedLocale)
Creates an XML representation of a list of locales. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LocaleManager(IPerson person)
person
- the userpublic LocaleManager(IPerson person, java.lang.String acceptLanguage)
Accept-Language
request header
from a user's browser.
person
- the useracceptLanguage
- the Accept-Language request header from a user's browserMethod Detail |
public static boolean isLocaleAware()
public static java.util.Locale getJvmLocale()
public static java.util.Locale[] getPortalLocales()
public java.util.Locale[] getBrowserLocales()
public java.util.Locale[] getUserLocales()
public java.util.Locale[] getSessionLocales()
public static void setJvmLocale(java.util.Locale jvmLocale)
public static void setPortalLocales(java.util.Locale[] portalLocales)
public void setBrowserLocales(java.util.Locale[] browserLocales)
public void setUserLocales(java.util.Locale[] userLocales)
public void setSessionLocales(java.util.Locale[] sessionLocales)
public java.util.Locale[] getLocales()
public static java.util.Locale[] parseLocales(java.lang.String localeStringList)
java.util.Locale
array from
a comma-delimited locale string list, e.g. "en_US,ja_JP"
localeStringList
- the locales to parse
public static java.util.Locale parseLocale(java.lang.String localeString)
java.util.Locale
object from
a locale string such as en_US or ja_JP.
localeString
- a locale string such as en_US
public static java.lang.String stringValueOf(java.util.Locale[] locales)
locales
- the list of locales
public void persistUserLocales(java.util.Locale[] userLocales) throws java.lang.Exception
userLocales
- the user locales preference
java.lang.Exception
public static org.w3c.dom.Document xmlValueOf(java.util.Locale[] locales)
locales
- the locale list
public static org.w3c.dom.Document xmlValueOf(java.util.Locale[] locales, java.util.Locale selectedLocale)
locales
- the locale listselectedLocale
- a locale that should be selected if it is in the list
public java.lang.String toString()
|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |