org.springframework.format.datetime.joda

## 类 JodaTimeFormatterRegistrar

- java.lang.Object
- - org.springframework.format.datetime.joda.JodaTimeFormatterRegistrar

- 所有已实现的接口:
    FormatterRegistrar

      public class JodaTimeFormatterRegistrar
      extends Object
      implements FormatterRegistrar

  Configures Joda-Time's formatting system for use with Spring.

  NOTE: Spring's Joda-Time support requires Joda-Time 2.x, as of Spring 4.0.

  从以下版本开始:
    3.1
  作者:
    Keith Donald, Juergen Hoeller, Phillip Webb
  另请参阅:
    `setDateStyle(java.lang.String)`, `setTimeStyle(java.lang.String)`, `setDateTimeStyle(java.lang.String)`, `setUseIsoFormat(boolean)`, `FormatterRegistrar.registerFormatters(org.springframework.format.FormatterRegistry)`, `DateFormatterRegistrar`, `DateTimeFormatterFactoryBean`

- - ### 构造器概要

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

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `registerFormatters(FormatterRegistry registry)` Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.
    `void` | `setDateFormatter(DateTimeFormatter formatter)` Set the formatter that will be used for objects representing date values.
    `void` | `setDateStyle(String dateStyle)` Set the default format style of Joda `LocalDate` objects.
    `void` | `setDateTimeFormatter(DateTimeFormatter formatter)` Set the formatter that will be used for objects representing date and time values.
    `void` | `setDateTimeStyle(String dateTimeStyle)` Set the default format style of Joda `LocalDateTime` and `DateTime` objects, as well as JDK `Date` and `Calendar` objects.
    `void` | `setTimeFormatter(DateTimeFormatter formatter)` Set the formatter that will be used for objects representing time values.
    `void` | `setTimeStyle(String timeStyle)` Set the default format style of Joda `LocalTime` objects.
    `void` | `setUseIsoFormat(boolean useIsoFormat)` Set whether standard ISO formatting should be applied to all date/time types.

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

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

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

    - #### JodaTimeFormatterRegistrar

          public JodaTimeFormatterRegistrar()

  - ### 方法详细资料

    - #### setUseIsoFormat

          public 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.

    - #### setDateStyle

          public void setDateStyle(String dateStyle)

      Set the default format style of Joda `LocalDate` objects. Default is `DateTimeFormat.shortDate()`.

    - #### setTimeStyle

          public void setTimeStyle(String timeStyle)

      Set the default format style of Joda `LocalTime` objects. Default is `DateTimeFormat.shortTime()`.

    - #### setDateTimeStyle

          public void setDateTimeStyle(String dateTimeStyle)

      Set the default format style of Joda `LocalDateTime` and `DateTime` objects, as well as JDK `Date` and `Calendar` objects. Default is `DateTimeFormat.shortDateTime()`.

    - #### setDateFormatter

          public void setDateFormatter(DateTimeFormatter formatter)

      Set the formatter that will be used for objects representing date values.

      This formatter will be used for the `LocalDate` type. When specified the `dateStyle` and `useIsoFormat` properties will be ignored.

      参数:
        `formatter` - the formatter to use
      从以下版本开始:
        3.2
      另请参阅:
        `setTimeFormatter(org.joda.time.format.DateTimeFormatter)`, `setDateTimeFormatter(org.joda.time.format.DateTimeFormatter)`

    - #### setTimeFormatter

          public void setTimeFormatter(DateTimeFormatter formatter)

      Set the formatter that will be used for objects representing time values.

      This formatter will be used for the `LocalTime` type. When specified the `timeStyle` and `useIsoFormat` properties will be ignored.

      参数:
        `formatter` - the formatter to use
      从以下版本开始:
        3.2
      另请参阅:
        `setDateFormatter(org.joda.time.format.DateTimeFormatter)`, `setDateTimeFormatter(org.joda.time.format.DateTimeFormatter)`

    - #### setDateTimeFormatter

          public void setDateTimeFormatter(DateTimeFormatter formatter)

      Set the formatter that will be used for objects representing date and time values.

      This formatter will be used for `LocalDateTime`, `ReadableInstant`, `Date` and `Calendar` types. When specified the `dateTimeStyle` and `useIsoFormat` properties will be ignored.

      参数:
        `formatter` - the formatter to use
      从以下版本开始:
        3.2
      另请参阅:
        `setDateFormatter(org.joda.time.format.DateTimeFormatter)`, `setTimeFormatter(org.joda.time.format.DateTimeFormatter)`

    - #### 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.