Class DateTimeFormatterRegistrar
java.lang.Object
org.springframework.format.datetime.standard.DateTimeFormatterRegistrar
- All Implemented Interfaces:
- FormatterRegistrar
Configures the JSR-310 
java.time formatting system for use with Spring.- Since:
- 4.0
- Author:
- Juergen Hoeller, Phillip Webb
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidregisterFormatters(FormatterRegistry registry) Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.voidsetDateFormatter(DateTimeFormatter formatter) Set the formatter that will be used for objects representing date values.voidsetDateStyle(FormatStyle dateStyle) Set the default format style ofLocalDateobjects.voidsetDateTimeFormatter(DateTimeFormatter formatter) Set the formatter that will be used for objects representing date and time values.voidsetDateTimeStyle(FormatStyle dateTimeStyle) Set the default format style ofLocalDateTimeobjects.voidsetTimeFormatter(DateTimeFormatter formatter) Set the formatter that will be used for objects representing time values.voidsetTimeStyle(FormatStyle timeStyle) Set the default format style ofLocalTimeobjects.voidsetUseIsoFormat(boolean useIsoFormat) Set whether standard ISO formatting should be applied to all date/time types.
- 
Constructor Details- 
DateTimeFormatterRegistrarpublic DateTimeFormatterRegistrar()
 
- 
- 
Method Details- 
setUseIsoFormatpublic 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 effectively ignored. 
- 
setDateStyleSet the default format style ofLocalDateobjects.Default is FormatStyle.SHORT.
- 
setTimeStyleSet the default format style ofLocalTimeobjects.Default is FormatStyle.SHORT.
- 
setDateTimeStyleSet the default format style ofLocalDateTimeobjects.Default is FormatStyle.SHORT.
- 
setDateFormatterSet the formatter that will be used for objects representing date values.This formatter will be used for the LocalDatetype. When specified, thedateStyleanduseIsoFormatproperties will be ignored.- Parameters:
- formatter- the formatter to use
- See Also:
 
- 
setTimeFormatterSet the formatter that will be used for objects representing time values.This formatter will be used for the LocalTimeandOffsetTimetypes. When specified, thetimeStyleanduseIsoFormatproperties will be ignored.- Parameters:
- formatter- the formatter to use
- See Also:
 
- 
setDateTimeFormatterSet the formatter that will be used for objects representing date and time values.This formatter will be used for LocalDateTime,ZonedDateTime, andOffsetDateTimetypes. When specified, thedateTimeStyleanduseIsoFormatproperties will be ignored.- Parameters:
- formatter- the formatter to use
- See Also:
 
- 
registerFormattersDescription copied from interface:FormatterRegistrarRegister Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.- Specified by:
- registerFormattersin interface- FormatterRegistrar
- Parameters:
- registry- the FormatterRegistry instance to use.
 
 
-