Interface LocaleResolver
-
- All Known Implementing Classes:
AbstractLocaleResolver
,FixedLocaleResolver
,SessionLocaleResolver
public interface LocaleResolver
Interface for locale and timezone resolution strategiesCreated: 2016. 3. 13.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Locale
resolveLocale(Translet translet)
Resolve the current locale via the given translet.java.util.TimeZone
resolveTimeZone(Translet translet)
Resolve the current timezone via the given translet.void
setLocale(Translet translet, java.util.Locale locale)
Set the current locale to the given one.void
setTimeZone(Translet translet, java.util.TimeZone timeZone)
Set the current timezone to the given one.
-
-
-
Method Detail
-
resolveLocale
java.util.Locale resolveLocale(Translet translet)
Resolve the current locale via the given translet. Can return a default locale as fallback in any case.- Parameters:
translet
- the translet to resolve the locale for- Returns:
- the current locale (never
null
)
-
resolveTimeZone
java.util.TimeZone resolveTimeZone(Translet translet)
Resolve the current timezone via the given translet. Can return a default timezone as fallback in any case.- Parameters:
translet
- the translet to resolve the timezone for- Returns:
- the current timezone (never
null
)
-
setLocale
void setLocale(Translet translet, java.util.Locale locale)
Set the current locale to the given one.- Parameters:
translet
- the translet to resolve the locale forlocale
- the new locale, ornull
to clear the locale- Throws:
java.lang.UnsupportedOperationException
- if the LocaleResolver implementation does not support dynamic changing of the locale
-
setTimeZone
void setTimeZone(Translet translet, java.util.TimeZone timeZone)
Set the current timezone to the given one.- Parameters:
translet
- the translet to resolve the locale fortimeZone
- the new timezone, ornull
to clear the timezone- Throws:
java.lang.UnsupportedOperationException
- if the LocaleResolver implementation does not support dynamic changing of the timezone
-
-