public final class

JodaTimeContextHolder

extends Object
java.lang.Object
   ↳ org.springframework.format.datetime.joda.JodaTimeContextHolder

Class Overview

A holder for a thread-local user JodaTimeContext.

Summary

Public Constructors
JodaTimeContextHolder()
Public Methods
static DateTimeFormatter getFormatter(DateTimeFormatter formatter, Locale locale)
Obtain a DateTimeFormatter with user-specific settings applied to the given base Formatter.
static JodaTimeContext getJodaTimeContext()
Return the JodaTimeContext associated with the current thread, if any.
static void resetJodaTimeContext()
Reset the JodaTimeContext for the current thread.
static void setJodaTimeContext(JodaTimeContext jodaTimeContext)
Associate the given JodaTimeContext with the current thread.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public JodaTimeContextHolder ()

Public Methods

public static DateTimeFormatter getFormatter (DateTimeFormatter formatter, Locale locale)

Obtain 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 null if not known)
Returns
  • the user-specific DateTimeFormatter

public static JodaTimeContext getJodaTimeContext ()

Return the JodaTimeContext associated with the current thread, if any.

Returns
  • the current JodaTimeContext, or null if none

public static void resetJodaTimeContext ()

Reset the JodaTimeContext for the current thread.

public static void setJodaTimeContext (JodaTimeContext jodaTimeContext)

Associate the given JodaTimeContext with the current thread.

Parameters
jodaTimeContext the current JodaTimeContext, or null to reset the thread-bound context