public class SimpleLocaleContext extends java.lang.Object implements LocaleContext
LocaleContext
interface,
always returning a specified Locale
.LocaleContextHolder.setLocaleContext(org.springframework.context.i18n.LocaleContext)
,
LocaleContextHolder.getLocale()
,
SimpleTimeZoneAwareLocaleContext
Constructor and Description |
---|
SimpleLocaleContext(java.util.Locale locale)
Create a new SimpleLocaleContext that exposes the specified Locale.
|
Modifier and Type | Method and Description |
---|---|
java.util.Locale |
getLocale()
Return the current Locale, which can be fixed or determined dynamically,
depending on the implementation strategy.
|
java.lang.String |
toString() |
public SimpleLocaleContext(@Nullable java.util.Locale locale)
getLocale()
call will return this Locale.locale
- the Locale to expose, or null
for no specific one@Nullable public java.util.Locale getLocale()
LocaleContext
getLocale
in interface LocaleContext
null
if no specific Locale associatedpublic java.lang.String toString()
toString
in class java.lang.Object