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 java.lang.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

Field Summary
private  java.lang.String dateStyle
           
private  java.lang.String dateTimeStyle
           
private  java.lang.String timeStyle
           
private  boolean useIsoFormat
           
 
Constructor Summary
JodaTimeFormatterRegistrar()
           
 
Method Summary
private  DateTimeFormatter getJodaDateFormatter()
           
private  DateTimeFormatter getJodaDateTimeFormatter()
           
private  DateTimeFormatter getJodaTimeFormatter()
           
 void registerFormatters(FormatterRegistry registry)
          Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.
 void setDateStyle(java.lang.String dateStyle)
          Set the default format style of Joda LocalDate objects.
 void setDateTimeStyle(java.lang.String dateTimeStyle)
          Set the default format style of Joda LocalDateTime and DateTime objects, as well as JDK Date and Calendar objects.
 void setTimeStyle(java.lang.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
 

Field Detail

dateStyle

private java.lang.String dateStyle

timeStyle

private java.lang.String timeStyle

dateTimeStyle

private java.lang.String dateTimeStyle

useIsoFormat

private boolean useIsoFormat
Constructor Detail

JodaTimeFormatterRegistrar

public JodaTimeFormatterRegistrar()
Method Detail

setDateStyle

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


setTimeStyle

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


setDateTimeStyle

public void setDateTimeStyle(java.lang.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.

getJodaDateFormatter

private DateTimeFormatter getJodaDateFormatter()

getJodaTimeFormatter

private DateTimeFormatter getJodaTimeFormatter()

getJodaDateTimeFormatter

private DateTimeFormatter getJodaDateTimeFormatter()