LocaleContextResolver implementation that always returns a fixed locale
and optionally time zone. Default is the current JVM's default locale.Note
Does not support setLocaleContext, as the fixed locale and
time zone cannot be changed.
| Access | Constructor and Description |
|---|---|
| public | FixedLocaleContextResolver()
Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback). |
| public | FixedLocaleContextResolver(Locale
the locale to expose locale)Create a FixedLocaleResolver that exposes the given locale. |
| public | FixedLocaleContextResolver(Locale
the locale to expose locale, TimeZone the time zone to expose timeZone)Create a FixedLocaleResolver that exposes the given locale and time zone. |
| Modifier and Type | Method and Description |
|---|---|
| public LocaleContext | resolveLocaleContext(ServerWebExchange
current server exchange exchange)Implements org. Resolve the current locale context via the given exchange. |
| public void | setLocaleContext(ServerWebExchange
current server exchange exchange, LocaleContext the new locale context, or localeContext)null to clear the localeImplements org. Set the current locale context to the given one, potentially including a locale with associated time zone information. |
| locale | back to summary |
|---|---|
| private final Locale locale | |
| timeZone | back to summary |
|---|---|
| private final TimeZone timeZone
| |
| FixedLocaleContextResolver | back to summary |
|---|---|
| public FixedLocaleContextResolver() Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback). | |
| FixedLocaleContextResolver | back to summary |
|---|---|
| public FixedLocaleContextResolver(Locale locale) Create a FixedLocaleResolver that exposes the given locale.
| |
| FixedLocaleContextResolver | back to summary |
|---|---|
| public FixedLocaleContextResolver(Locale locale, TimeZone timeZone) Create a FixedLocaleResolver that exposes the given locale and time zone. | |
| resolveLocaleContext | back to summary |
|---|---|
| public LocaleContext resolveLocaleContext(ServerWebExchange exchange) Implements org. Doc from org. Resolve the current locale context via the given exchange. The returned context may be a
Custom resolver implementations may also return extra settings in the returned context, which again can be accessed through downcasting.
| |
| setLocaleContext | back to summary |
|---|---|
| public void setLocaleContext(ServerWebExchange exchange, LocaleContext localeContext) Implements org. Doc from org. Set the current locale context to the given one, potentially including a locale with associated time zone information.
| |