public final class DateTimeContextHolder extends Object
DateTimeContext
.Constructor and Description |
---|
DateTimeContextHolder() |
Modifier and Type | Method and Description |
---|---|
static DateTimeContext |
getDateTimeContext()
Return the DateTimeContext associated with the current thread, if any.
|
static java.time.format.DateTimeFormatter |
getFormatter(java.time.format.DateTimeFormatter formatter,
Locale locale)
Obtain a DateTimeFormatter with user-specific settings applied to the given base Formatter.
|
static void |
resetDateTimeContext()
Reset the DateTimeContext for the current thread.
|
static void |
setDateTimeContext(DateTimeContext dateTimeContext)
Associate the given DateTimeContext with the current thread.
|
public static void resetDateTimeContext()
public static void setDateTimeContext(DateTimeContext dateTimeContext)
dateTimeContext
- the current DateTimeContext,
or null
to reset the thread-bound contextpublic static DateTimeContext getDateTimeContext()
null
if nonepublic static java.time.format.DateTimeFormatter getFormatter(java.time.format.DateTimeFormatter formatter, Locale locale)
formatter
- the base formatter that establishes default formatting rules
(generally user independent)locale
- the current user locale (may be null
if not known)