org.springframework.format.datetime.joda

## 类 DateTimeFormatterFactory

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

- 直接已知子类:
    DateTimeFormatterFactoryBean

      public class DateTimeFormatterFactory
      extends Object

  Factory that creates a Joda-Time `DateTimeFormatter`.

  Formatters will be created using the defined `pattern`, `ISO`, and `style` methods (considered in that order).

  从以下版本开始:
    3.2
  作者:
    Phillip Webb, Sam Brannen
  另请参阅:
    `createDateTimeFormatter()`, `createDateTimeFormatter(DateTimeFormatter)`, `setPattern(java.lang.String)`, `setStyle(java.lang.String)`, `setIso(org.springframework.format.annotation.DateTimeFormat.ISO)`, `DateTimeFormatterFactoryBean`

- - ### 构造器概要

    构造器
    构造器和说明
    `DateTimeFormatterFactory()` Create a new `DateTimeFormatterFactory` instance.
    `DateTimeFormatterFactory(String pattern)` Create a new `DateTimeFormatterFactory` instance.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `DateTimeFormatter` | `createDateTimeFormatter()` Create a new `DateTimeFormatter` using this factory.
    `DateTimeFormatter` | `createDateTimeFormatter(DateTimeFormatter fallbackFormatter)` Create a new `DateTimeFormatter` using this factory.
    `void` | `setIso(DateTimeFormat.ISO iso)` Set the ISO format used to format date values.
    `void` | `setPattern(String pattern)` Set the pattern to use to format date values.
    `void` | `setStyle(String style)` Set the two characters to use to format date values, in Joda-Time style.
    `void` | `setTimeZone(TimeZone timeZone)` Set the `TimeZone` to normalize the date values into, if any.

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

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

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

    - #### DateTimeFormatterFactory

          public DateTimeFormatterFactory()

      Create a new `DateTimeFormatterFactory` instance.

    - #### DateTimeFormatterFactory

          public DateTimeFormatterFactory(String pattern)

      Create a new `DateTimeFormatterFactory` instance.
      参数:
        `pattern` - the pattern to use to format date values

  - ### 方法详细资料

    - #### setPattern

          public void setPattern(String pattern)

      Set the pattern to use to format date values.
      参数:
        `pattern` - the format pattern

    - #### setIso

          public void setIso(DateTimeFormat.ISO iso)

      Set the ISO format used to format date values.
      参数:
        `iso` - the ISO format

    - #### setStyle

          public void setStyle(String style)

      Set the two characters to use to format date values, in Joda-Time style.

      The first character is used for the date style; the second is for the time style. Supported characters are:

      - 'S' = Small
      - 'M' = Medium
      - 'L' = Long
      - 'F' = Full
      - '-' = Omitted
      参数:
        `style` - two characters from the set {"S", "M", "L", "F", "-"}

    - #### setTimeZone

          public void setTimeZone(TimeZone timeZone)

      Set the `TimeZone` to normalize the date values into, if any.
      参数:
        `timeZone` - the time zone

    - #### createDateTimeFormatter

          public DateTimeFormatter createDateTimeFormatter()

      Create a new `DateTimeFormatter` using this factory.

      If no specific pattern or style has been defined, `medium date time format` will be used.

      返回:
        a new date time formatter
      另请参阅:
        `createDateTimeFormatter(DateTimeFormatter)`

    - #### createDateTimeFormatter

          public DateTimeFormatter createDateTimeFormatter(DateTimeFormatter fallbackFormatter)

      Create a new `DateTimeFormatter` using this factory.

      If no specific pattern or style has been defined, the supplied `fallbackFormatter` will be used.

      参数:
        `fallbackFormatter` - the fall-back formatter to use when no specific factory properties have been set
      返回:
        a new date time formatter