Class DateTimeContextHolder
java.lang.Object
org.springframework.format.datetime.standard.DateTimeContextHolder
A holder for a thread-local user 
DateTimeContext.- Since:
- 4.0
- Author:
- Juergen Hoeller
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionstatic 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.
- 
Method Details- 
resetDateTimeContextpublic static void resetDateTimeContext()Reset the DateTimeContext for the current thread.
- 
setDateTimeContextAssociate the given DateTimeContext with the current thread.- Parameters:
- dateTimeContext- the current DateTimeContext, or- nullto reset the thread-bound context
 
- 
getDateTimeContextReturn the DateTimeContext associated with the current thread, if any.- Returns:
- the current DateTimeContext, or nullif none
 
- 
getFormatterObtain a DateTimeFormatter with user-specific settings applied to the given base formatter.- Parameters:
- formatter- the base formatter that establishes default formatting rules (generally user independent)
- locale- the current user locale (may be- nullif not known)
- Returns:
- the user-specific DateTimeFormatter
 
 
-