## 接口的使用
org.springframework.context.i18n.LocaleContext

- 使用LocaleContext的程序包
  程序包 | 说明
  --- | ---
  org.springframework.context.i18n | Abstraction for determining the current Locale, plus global holder that exposes a thread-bound Locale.

- - ### org.springframework.context.i18n中LocaleContext的使用

    org.springframework.context.i18n中LocaleContext的子接口
    限定符和类型 | 接口和说明
    --- | ---
    `interface` | `TimeZoneAwareLocaleContext` Extension of `LocaleContext`, adding awareness of the current time zone.

    实现LocaleContext的org.springframework.context.i18n中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `SimpleLocaleContext` Simple implementation of the `LocaleContext` interface, always returning a specified `Locale`.
    `class` | `SimpleTimeZoneAwareLocaleContext` Simple implementation of the `TimeZoneAwareLocaleContext` interface, always returning a specified `Locale` and `TimeZone`.

    返回LocaleContext的org.springframework.context.i18n中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static LocaleContext` | LocaleContextHolder.`getLocaleContext()` Return the LocaleContext associated with the current thread, if any.

    参数类型为LocaleContext的org.springframework.context.i18n中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static Locale` | LocaleContextHolder.`getLocale(LocaleContext localeContext)` Return the Locale associated with the given user context, if any, or the system default Locale otherwise.
    `static TimeZone` | LocaleContextHolder.`getTimeZone(LocaleContext localeContext)` Return the TimeZone associated with the given user context, if any, or the system default TimeZone otherwise.
    `static void` | LocaleContextHolder.`setLocaleContext(LocaleContext localeContext)` Associate the given LocaleContext with the current thread, not exposing it as inheritable for child threads.
    `static void` | LocaleContextHolder.`setLocaleContext(LocaleContext localeContext, boolean inheritable)` Associate the given LocaleContext with the current thread.