类 SimpleLocaleContext
- java.lang.Object
- org.springframework.context.i18n.SimpleLocaleContext
- 所有已实现的接口:
LocaleContext
public class SimpleLocaleContext extends Object implements LocaleContext
Simple implementation of theLocaleContextinterface, always returning a specifiedLocale.- 从以下版本开始:
- 1.2
- 作者:
- Juergen Hoeller
- 另请参阅:
LocaleContextHolder.setLocaleContext(org.springframework.context.i18n.LocaleContext),LocaleContextHolder.getLocale(),SimpleTimeZoneAwareLocaleContext
构造器概要
构造器 构造器 说明 SimpleLocaleContext(Locale locale)Create a new SimpleLocaleContext that exposes the specified Locale.
构造器详细资料
SimpleLocaleContext
public SimpleLocaleContext(@Nullable Locale locale)
Create a new SimpleLocaleContext that exposes the specified Locale. EverygetLocale()call will return this Locale.- 参数:
locale- the Locale to expose, ornullfor no specific one
方法详细资料
getLocale
@Nullable public Locale getLocale()
从接口复制的说明:LocaleContextReturn the current Locale, which can be fixed or determined dynamically, depending on the implementation strategy.- 指定者:
getLocale在接口中LocaleContext- 返回:
- the current Locale, or
nullif no specific Locale associated