public class SimpleTimeZoneAwareLocaleContext extends SimpleLocaleContext implements TimeZoneAwareLocaleContext
TimeZoneAwareLocaleContext
interface,
always returning a specified Locale
and TimeZone
.
Note: Prefer the use of SimpleLocaleContext
when only setting
a Locale but no TimeZone.
LocaleContextHolder.setLocaleContext(org.springframework.context.i18n.LocaleContext)
,
LocaleContextHolder.getTimeZone()
Constructor and Description |
---|
SimpleTimeZoneAwareLocaleContext(Locale locale,
TimeZone timeZone)
Create a new SimpleTimeZoneAwareLocaleContext that exposes the specified
Locale and TimeZone.
|
Modifier and Type | Method and Description |
---|---|
TimeZone |
getTimeZone()
Return the current TimeZone, which can be fixed or determined dynamically,
depending on the implementation strategy.
|
String |
toString() |
getLocale
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getLocale
public SimpleTimeZoneAwareLocaleContext(Locale locale, TimeZone timeZone)
SimpleLocaleContext.getLocale()
call will return the given
Locale, and every getTimeZone()
call will return the given TimeZone.locale
- the Locale to exposetimeZone
- the TimeZone to exposepublic TimeZone getTimeZone()
TimeZoneAwareLocaleContext
getTimeZone
in interface TimeZoneAwareLocaleContext
null
if no specific TimeZone associatedpublic String toString()
toString
in class SimpleLocaleContext