|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.service.request.LocaleManager
public class LocaleManager
manages the registered locales and maps user locales to the best matching registered locale.
| Constructor Summary | |
|---|---|
protected |
LocaleManager(ServiceRequestImplConfig conf)
creates a new LocaleManager. |
| Method Summary | |
|---|---|
java.util.Locale |
findBestMatchingLocale(java.util.Locale locale, ServiceRequest request)
returns the best matching locale for the given parameters. |
java.util.Locale |
findBestMatchingLocale(java.lang.String localeString, ServiceRequest request)
returns the best matching locale for the given parameters. |
java.util.Locale |
findLocaleByGivenValues(java.lang.String language,
java.lang.String country,
java.lang.String variant)
tries to find a known Locale which best matches the given values
for language, country and variant. |
java.util.Locale |
getDefaultLocale()
returns the default locale, if set. |
static LocaleManager |
getInstance()
returns the LocaleManager instance. |
java.util.Collection<Locale> |
getLocales()
returns the configured locales. |
protected boolean |
hasDefault()
returns whether the LocaleManager has a default locale. |
static java.util.Locale |
localeToLocale(Locale l)
builds a java.util.Locale matching an org.torweg.pulse.service.Locale. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected LocaleManager(ServiceRequestImplConfig conf)
conf - the configuration| Method Detail |
|---|
public final java.util.Collection<Locale> getLocales()
public final java.util.Locale getDefaultLocale()
public final java.util.Locale findBestMatchingLocale(java.lang.String localeString, ServiceRequest request)
localeString - the preferred locale (may be null)request - the current request (may be null)
public final java.util.Locale findBestMatchingLocale(java.util.Locale locale, ServiceRequest request)
locale - the preferred locale (may be null)request - the current request (may be null)
public final java.util.Locale findLocaleByGivenValues(java.lang.String language,
java.lang.String country,
java.lang.String variant)
Locale which best matches the given values
for language, country and variant.
language - the given languagecountry - the given countryvariant - the given variant
Locale or null, if no matching Locale could be foundpublic static final java.util.Locale localeToLocale(Locale l)
java.util.Locale matching an org.torweg.pulse.service.Locale.
l - the org.torweg.pulse.service.Locale
java.util.Localepublic static final LocaleManager getInstance()
LocaleManager instance.
LocaleManagerprotected final boolean hasDefault()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||