类 FixedLocaleResolver
java.lang.Object
cn.taketoday.web.i18n.AbstractLocaleResolver
cn.taketoday.web.i18n.AbstractLocaleContextResolver
cn.taketoday.web.i18n.FixedLocaleResolver
- 所有已实现的接口:
LocaleContextResolver,LocaleResolver
LocaleResolver implementation
that always returns a fixed default locale and optionally time zone.
Default is the current JVM's default locale.
Note: Does not support setLocale(Context), as the fixed
locale and time zone cannot be changed.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
字段概要
从接口继承的字段 cn.taketoday.web.LocaleResolver
BEAN_NAME -
构造器概要
构造器构造器说明Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback).FixedLocaleResolver(Locale locale) Create a FixedLocaleResolver that exposes the given locale.FixedLocaleResolver(Locale locale, TimeZone timeZone) Create a FixedLocaleResolver that exposes the given locale and time zone. -
方法概要
修饰符和类型方法说明resolveLocale(RequestContext request) Resolve the current locale via the given request.cn.taketoday.core.i18n.LocaleContextresolveLocaleContext(RequestContext request) Resolve the current locale context via the given request.voidsetLocaleContext(RequestContext request, cn.taketoday.core.i18n.LocaleContext localeContext) Set the current locale context to the given one, potentially including a locale with associated time zone information.从类继承的方法 cn.taketoday.web.i18n.AbstractLocaleContextResolver
getDefaultTimeZone, setDefaultTimeZone, setLocale从类继承的方法 cn.taketoday.web.i18n.AbstractLocaleResolver
getDefaultLocale, setDefaultLocale
-
构造器详细资料
-
FixedLocaleResolver
public FixedLocaleResolver()Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback). -
FixedLocaleResolver
Create a FixedLocaleResolver that exposes the given locale.- 参数:
locale- the locale to expose
-
FixedLocaleResolver
Create a FixedLocaleResolver that exposes the given locale and time zone.- 参数:
locale- the locale to exposetimeZone- the time zone to expose
-
-
方法详细资料
-
resolveLocale
从接口复制的说明:LocaleResolverResolve the current locale via the given request. Can return a default locale as fallback in any case.- 指定者:
resolveLocale在接口中LocaleResolver- 覆盖:
resolveLocale在类中AbstractLocaleContextResolver- 参数:
request- the request to resolve the locale for- 返回:
- the current locale (never
null)
-
resolveLocaleContext
从接口复制的说明:LocaleContextResolverResolve the current locale context via the given request.This is primarily intended for framework-level processing; consider using
RequestContextUtilsorRequestContextfor 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 aninstanceofcheck 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
public void setLocaleContext(RequestContext request, @Nullable cn.taketoday.core.i18n.LocaleContext localeContext) 从接口复制的说明:LocaleContextResolverSet 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 modificationlocaleContext- the new locale context, ornullto clear the locale- 另请参阅:
-
LocaleResolver.setLocale(RequestContext, Locale)SimpleLocaleContextSimpleTimeZoneAwareLocaleContext
-