类 DateTimeContextHolder
java.lang.Object
cn.taketoday.format.datetime.standard.DateTimeContextHolder
A holder for a thread-local user
DateTimeContext.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
LocaleContextHolder
-
方法概要
修饰符和类型方法说明static DateTimeContextReturn the DateTimeContext associated with the current thread, if any.static DateTimeFormattergetFormatter(DateTimeFormatter formatter, Locale locale) Obtain a DateTimeFormatter with user-specific settings applied to the given base formatter.static voidReset the DateTimeContext for the current thread.static voidsetDateTimeContext(DateTimeContext dateTimeContext) Associate the given DateTimeContext with the current thread.
-
方法详细资料
-
resetDateTimeContext
public static void resetDateTimeContext()Reset the DateTimeContext for the current thread. -
setDateTimeContext
Associate the given DateTimeContext with the current thread.- 参数:
dateTimeContext- the current DateTimeContext, ornullto reset the thread-bound context
-
getDateTimeContext
Return the DateTimeContext associated with the current thread, if any.- 返回:
- the current DateTimeContext, or
nullif none
-
getFormatter
Obtain a DateTimeFormatter with user-specific settings applied to the given base formatter.- 参数:
formatter- the base formatter that establishes default formatting rules (generally user independent)locale- the current user locale (may benullif not known)- 返回:
- the user-specific DateTimeFormatter
-