程序包 cn.taketoday.web

接口 LocaleContextResolver

所有超级接口:
LocaleResolver
所有已知实现类:
AbstractLocaleContextResolver, CookieLocaleResolver, FixedLocaleResolver, SessionLocaleResolver

public interface LocaleContextResolver extends LocaleResolver
Extension of LocaleResolver, adding support for a rich locale context (potentially including locale and time zone information).
从以下版本开始:
4.0 2022/2/3 22:54
作者:
Juergen Hoeller, Harry Yang
另请参阅:
  • 方法详细资料

    • resolveLocaleContext

      cn.taketoday.core.i18n.LocaleContext resolveLocaleContext(RequestContext request)
      Resolve the current locale context via the given request.

      This is primarily intended for framework-level processing; consider using RequestContextUtils or RequestContext for application-level access to the current locale and/or time zone.

      The returned context may be a TimeZoneAwareLocaleContext, containing a locale with associated time zone information. Simply apply an instanceof check and downcast accordingly.

      Custom resolver implementations may also return extra settings in the returned context, which again can be accessed through downcasting.

      参数:
      request - the request to resolve the locale context for
      返回:
      the current locale context (never null
      另请参阅:
    • setLocaleContext

      void setLocaleContext(RequestContext request, @Nullable cn.taketoday.core.i18n.LocaleContext localeContext)
      Set the current locale context to the given one, potentially including a locale with associated time zone information.
      参数:
      request - the request to be used for locale modification
      localeContext - the new locale context, or null to clear the locale
      抛出:
      UnsupportedOperationException - if the LocaleResolver implementation does not support dynamic changing of the locale or time zone
      另请参阅: