org.springframework.format.datetime.joda
Class JodaTimeFormatterRegistrar

java.lang.Object
  extended by org.springframework.format.datetime.joda.JodaTimeFormatterRegistrar
All Implemented Interfaces:
FormatterRegistrar

public class JodaTimeFormatterRegistrar
extends Object
implements FormatterRegistrar

Configures Joda Time's Formatting system for use with Spring.

Since:
3.1
Author:
Keith Donald, Juergen Hoeller
See Also:
setDateStyle(java.lang.String), setTimeStyle(java.lang.String), setDateTimeStyle(java.lang.String), setUseIsoFormat(boolean), #installJodaTimeFormatting

Constructor Summary
JodaTimeFormatterRegistrar()
           
 
Method Summary
 void registerFormatters(FormatterRegistry registry)
          Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.
 void setDateStyle(String dateStyle)
          Set the default format style of Joda LocalDate objects.
 void setDateTimeStyle(String dateTimeStyle)
          Set the default format style of Joda LocalDateTime and DateTime objects, as well as JDK Date and Calendar objects.
 void setTimeStyle(String timeStyle)
          Set the default format style of Joda LocalTime objects.
 void setUseIsoFormat(boolean useIsoFormat)
          Set whether standard ISO formatting should be applied to all Date/Time types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JodaTimeFormatterRegistrar

public JodaTimeFormatterRegistrar()
Method Detail

setDateStyle

public void setDateStyle(String dateStyle)
Set the default format style of Joda LocalDate objects. Default is DateTimeFormat.shortDate().


setTimeStyle

public void setTimeStyle(String timeStyle)
Set the default format style of Joda LocalTime objects. Default is DateTimeFormat.shortTime().


setDateTimeStyle

public void setDateTimeStyle(String dateTimeStyle)
Set the default format style of Joda LocalDateTime and DateTime objects, as well as JDK Date and Calendar objects. Default is DateTimeFormat.shortDateTime().


setUseIsoFormat

public void setUseIsoFormat(boolean useIsoFormat)
Set whether standard ISO formatting should be applied to all Date/Time types. Default is false (no). If set to true, the dateStyle, timeStyle, and dateTimeStyle properties are ignored.


registerFormatters

public void registerFormatters(FormatterRegistry registry)
Description copied from interface: FormatterRegistrar
Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.

Specified by:
registerFormatters in interface FormatterRegistrar
Parameters:
registry - the FormatterRegistry instance to use.