org.springframework.format.datetime

## 类 DateFormatterRegistrar

- java.lang.Object
- - org.springframework.format.datetime.DateFormatterRegistrar

- 所有已实现的接口:
    FormatterRegistrar

      public class DateFormatterRegistrar
      extends Object
      implements 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.

  从以下版本开始:
    3.2
  作者:
    Phillip Webb
  另请参阅:
    `DateTimeFormatterRegistrar`, `JodaTimeFormatterRegistrar`, `FormatterRegistrar.registerFormatters(org.springframework.format.FormatterRegistry)`

- - ### 构造器概要

    构造器
    构造器和说明
    `DateFormatterRegistrar()`

  - ### 方法概要

    所有方法 静态方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static void` | `addDateConverters(org.springframework.core.convert.converter.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.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### DateFormatterRegistrar

          public DateFormatterRegistrar()

  - ### 方法详细资料

    - #### setFormatter

          public void setFormatter(DateFormatter dateFormatter)

      Set a global date formatter to register.

      If not specified, no general formatter for non-annotated `Date` and `Calendar` fields will be registered.

    - #### registerFormatters

          public void registerFormatters(FormatterRegistry registry)

      从接口复制的说明: `FormatterRegistrar`
      Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.
      指定者:
        `registerFormatters` 在接口中 `FormatterRegistrar`
      参数:
        `registry` - the FormatterRegistry instance to use.

    - #### addDateConverters

          public static void addDateConverters(org.springframework.core.convert.converter.ConverterRegistry converterRegistry)

      Add date converters to the specified registry.
      参数:
        `converterRegistry` - the registry of converters to add to