Class DateFormatterRegistrar
- java.lang.Object
- org.springframework.format.datetime.DateFormatterRegistrar
- All Implemented Interfaces:
FormatterRegistrar
public class DateFormatterRegistrar extends Object implements FormatterRegistrar
Configures basic date formatting for use with Spring, primarily forDateTimeFormatdeclarations. Applies to fields of typeDate,Calendarandlong.Designed for direct instantiation but also exposes the static
addDateConverters(ConverterRegistry)utility method for ad-hoc use against anyConverterRegistryinstance.- Since:
- 3.2
- Author:
- Phillip Webb
- See Also:
DateTimeFormatterRegistrar,JodaTimeFormatterRegistrar,FormatterRegistrar.registerFormatters(org.springframework.format.FormatterRegistry)
Constructor Summary
Constructors Constructor Description DateFormatterRegistrar()
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddDateConverters(ConverterRegistry converterRegistry)Add date converters to the specified registry.voidregisterFormatters(FormatterRegistry registry)Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.voidsetFormatter(DateFormatter dateFormatter)Set a global date formatter to register.
Constructor Detail
DateFormatterRegistrar
public DateFormatterRegistrar()
Method Detail
setFormatter
public void setFormatter(DateFormatter dateFormatter)
registerFormatters
public void registerFormatters(FormatterRegistry registry)
Description copied from interface:FormatterRegistrarRegister Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.- Specified by:
registerFormattersin interfaceFormatterRegistrar- Parameters:
registry- the FormatterRegistry instance to use.
addDateConverters
public static void addDateConverters(ConverterRegistry converterRegistry)
Add date converters to the specified registry.- Parameters:
converterRegistry- the registry of converters to add to