类 SimpleLocaleContext
- java.lang.Object
- org.springframework.context.i18n.SimpleLocaleContext
- 所有已实现的接口:
LocaleContext
public class SimpleLocaleContext extends Object implements LocaleContext
Simple implementation of theLocaleContext
interface, 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(Locale locale)
Create a new SimpleLocaleContext that exposes the specified Locale. EverygetLocale()
call will return this Locale.- 参数:
locale
- the Locale to expose
方法详细资料
getLocale
public Locale getLocale()
从接口复制的说明:LocaleContext
Return the current Locale, which can be fixed or determined dynamically, depending on the implementation strategy.- 指定者:
getLocale
在接口中LocaleContext
- 返回:
- the current Locale, or
null
if no specific Locale associated