Class DateFormatterRegistrar
java.lang.Object
org.springframework.format.datetime.DateFormatterRegistrar
- All Implemented Interfaces:
FormatterRegistrar
Configures basic date formatting for use with Spring, primarily for
DateTimeFormat declarations.
Applies to fields of type Date, Calendar, and long.
Designed for direct instantiation but also exposes the static
addDateConverters(ConverterRegistry) utility method for
ad-hoc use against any ConverterRegistry instance.
- Since:
- 3.2
- Author:
- Phillip Webb
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
DateFormatterRegistrar
public DateFormatterRegistrar()
-
-
Method Details
-
setFormatter
-
registerFormatters
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
Add date converters to the specified registry.- Parameters:
converterRegistry- the registry of converters to add to
-