Top Description Fields Constructors Methods
org.springframework.context.i18n

public Class SimpleTimeZoneAwareLocaleContext

extends SimpleLocaleContext
implements TimeZoneAwareLocaleContext
Class Inheritance
All Implemented Interfaces
org.springframework.context.i18n.TimeZoneAwareLocaleContext, org.springframework.context.i18n.LocaleContext
Imports
java.util.Locale, .TimeZone, org.springframework.lang.Nullable

Simple implementation of the TimeZoneAwareLocaleContext interface, always returning a specified Locale and TimeZone.

Note

Prefer the use of SimpleLocaleContext when only setting a Locale but no TimeZone.

Authors
Juergen Hoeller, Nicholas Williams
Since
4.0
See Also
LocaleContextHolder#setLocaleContext, LocaleContextHolder#getTimeZone()

Field Summary

Modifier and TypeField and Description
private final TimeZone

Constructor Summary

AccessConstructor and Description
public
SimpleTimeZoneAwareLocaleContext(Locale
the Locale to expose
locale
,
TimeZone
the TimeZone to expose
timeZone
)

Create a new SimpleTimeZoneAwareLocaleContext that exposes the specified Locale and TimeZone.

Method Summary

Modifier and TypeMethod and Description
public TimeZone
getTimeZone()

Implements org.springframework.context.i18n.TimeZoneAwareLocaleContext.getTimeZone.

Return the current TimeZone, which can be fixed or determined dynamically, depending on the implementation strategy.
public String
toString()

Overrides org.springframework.context.i18n.SimpleLocaleContext.toString.

Returns a string representation of the object.
Inherited from org.springframework.context.i18n.SimpleLocaleContext:
getLocale

Field Detail

timeZoneback to summary
private final TimeZone timeZone
Annotations
@Nullable

Constructor Detail

SimpleTimeZoneAwareLocaleContextback to summary
public SimpleTimeZoneAwareLocaleContext(Locale locale, TimeZone timeZone)

Create a new SimpleTimeZoneAwareLocaleContext that exposes the specified Locale and TimeZone. Every getLocale() call will return the given Locale, and every getTimeZone() call will return the given TimeZone.

Parameters
locale:Locale

the Locale to expose

timeZone:TimeZone

the TimeZone to expose

Method Detail

getTimeZoneback to summary
public TimeZone getTimeZone()

Implements org.springframework.context.i18n.TimeZoneAwareLocaleContext.getTimeZone.

Doc from org.springframework.context.i18n.TimeZoneAwareLocaleContext.getTimeZone.

Return the current TimeZone, which can be fixed or determined dynamically, depending on the implementation strategy.

Returns:TimeZone

the current TimeZone, or null if no specific TimeZone associated

Annotations
@Override
@Nullable
toStringback to summary
public String toString()

Overrides org.springframework.context.i18n.SimpleLocaleContext.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override