org.springframework.format.datetime.joda

Class DateTimeFormatterFactory

  • java.lang.Object
    • org.springframework.format.datetime.joda.DateTimeFormatterFactory
    • Constructor Detail

      • DateTimeFormatterFactory

        public DateTimeFormatterFactory()
        Create a new DateTimeFormatterFactory instance.
      • DateTimeFormatterFactory

        public DateTimeFormatterFactory(java.lang.String pattern)
        Create a new DateTimeFormatterFactory instance.
        Parameters:
        pattern - the pattern to use to format date values
    • Method Detail

      • setPattern

        public void setPattern(java.lang.String pattern)
        Set the pattern to use to format date values.
        Parameters:
        pattern - the format pattern
      • setIso

        public void setIso(DateTimeFormat.ISO iso)
        Set the ISO format used to format date values.
        Parameters:
        iso - the ISO format
      • setStyle

        public void setStyle(java.lang.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
        Parameters:
        style - two characters from the set {"S", "M", "L", "F", "-"}
      • setTimeZone

        public void setTimeZone(java.util.TimeZone timeZone)
        Set the TimeZone to normalize the date values into, if any.
        Parameters:
        timeZone - the time zone
      • 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.

        Parameters:
        fallbackFormatter - the fall-back formatter to use when no specific factory properties have been set
        Returns:
        a new date time formatter