类 SimpleTimeZoneAwareLocaleContext
- java.lang.Object
- org.springframework.context.i18n.SimpleLocaleContext
- org.springframework.context.i18n.SimpleTimeZoneAwareLocaleContext
- 所有已实现的接口:
LocaleContext,TimeZoneAwareLocaleContext
public class SimpleTimeZoneAwareLocaleContext extends SimpleLocaleContext implements TimeZoneAwareLocaleContext
Simple implementation of theTimeZoneAwareLocaleContextinterface, always returning a specifiedLocaleandTimeZone.Note: Prefer the use of
SimpleLocaleContextwhen only setting a Locale but no TimeZone.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Nicholas Williams
- 另请参阅:
LocaleContextHolder.setLocaleContext(org.springframework.context.i18n.LocaleContext),LocaleContextHolder.getTimeZone()
构造器概要
构造器 构造器 说明 SimpleTimeZoneAwareLocaleContext(Locale locale, TimeZone timeZone)Create a new SimpleTimeZoneAwareLocaleContext that exposes the specified Locale and TimeZone.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 TimeZonegetTimeZone()Return the current TimeZone, which can be fixed or determined dynamically, depending on the implementation strategy.StringtoString()从类继承的方法 org.springframework.context.i18n.SimpleLocaleContext
getLocale
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 org.springframework.context.i18n.LocaleContext
getLocale
构造器详细资料
SimpleTimeZoneAwareLocaleContext
public SimpleTimeZoneAwareLocaleContext(@Nullable Locale locale, @Nullable TimeZone timeZone)
Create a new SimpleTimeZoneAwareLocaleContext that exposes the specified Locale and TimeZone. EverySimpleLocaleContext.getLocale()call will return the given Locale, and everygetTimeZone()call will return the given TimeZone.- 参数:
locale- the Locale to exposetimeZone- the TimeZone to expose
方法详细资料
getTimeZone
@Nullable public TimeZone getTimeZone()
从接口复制的说明:TimeZoneAwareLocaleContextReturn the current TimeZone, which can be fixed or determined dynamically, depending on the implementation strategy.- 指定者:
getTimeZone在接口中TimeZoneAwareLocaleContext- 返回:
- the current TimeZone, or
nullif no specific TimeZone associated
toString
public String toString()
- 覆盖:
toString在类中SimpleLocaleContext