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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDateConverters
(ConverterRegistry converterRegistry) Add date converters to the specified registry.void
registerFormatters
(FormatterRegistry registry) Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.void
setFormatter
(DateFormatter dateFormatter) Set a global date formatter to register.
-
Constructor Details
-
DateFormatterRegistrar
public DateFormatterRegistrar()
-
-
Method Details
-
setFormatter
-
registerFormatters
Description copied from interface:FormatterRegistrar
Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.- Specified by:
registerFormatters
in 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
-