Class JacksonJodaDateFormat


  • public class JacksonJodaDateFormat
    extends java.lang.Object
    Simple container used to encapsulate (some of) gory details of customizations related to date/time formatting.
    • Field Detail

      • _formatter

        protected final org.joda.time.format.DateTimeFormatter _formatter
      • _jdkTimezone

        protected final java.util.TimeZone _jdkTimezone
      • _jodaTimezone

        protected transient org.joda.time.DateTimeZone _jodaTimezone
      • _explicitTimezone

        protected final boolean _explicitTimezone
      • _adjustToContextTZOverride

        protected final java.lang.Boolean _adjustToContextTZOverride
        Flag for JsonFormat.Feature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE
        Since:
        2.8
      • _writeZoneId

        protected final java.lang.Boolean _writeZoneId
        Flag for JsonFormat.Feature.WRITE_DATES_WITH_ZONE_ID
        Since:
        2.8
      • DEFAULT_LOCALE

        protected static final java.util.Locale DEFAULT_LOCALE
      • _useTimestamp

        protected final java.lang.Boolean _useTimestamp
        Flag that indicates that serialization must be done as the Java timestamp, regardless of other settings.
      • _locale

        protected final java.util.Locale _locale
      • _explicitLocale

        protected final boolean _explicitLocale
    • Constructor Detail

      • JacksonJodaDateFormat

        public JacksonJodaDateFormat​(org.joda.time.format.DateTimeFormatter defaultFormatter)
      • JacksonJodaDateFormat

        public JacksonJodaDateFormat​(JacksonJodaDateFormat base,
                                     java.lang.Boolean useTimestamp)
      • JacksonJodaDateFormat

        public JacksonJodaDateFormat​(JacksonJodaDateFormat base,
                                     org.joda.time.format.DateTimeFormatter formatter)
      • JacksonJodaDateFormat

        public JacksonJodaDateFormat​(JacksonJodaDateFormat base,
                                     java.util.TimeZone jdkTimezone)
      • JacksonJodaDateFormat

        public JacksonJodaDateFormat​(JacksonJodaDateFormat base,
                                     java.util.Locale locale)
      • JacksonJodaDateFormat

        protected JacksonJodaDateFormat​(JacksonJodaDateFormat base,
                                        java.lang.Boolean adjustToContextTZOverride,
                                        java.lang.Boolean writeZoneId)
        Since:
        2.8
    • Method Detail

      • withAdjustToContextTZOverride

        public JacksonJodaDateFormat withAdjustToContextTZOverride​(java.lang.Boolean adjustToContextTZOverride)
        Since:
        2.8
      • withWriteZoneId

        public JacksonJodaDateFormat withWriteZoneId​(java.lang.Boolean writeZoneId)
        Since:
        2.8
      • getTimeZone

        public org.joda.time.DateTimeZone getTimeZone()
        Since:
        2.6
      • getLocale

        public java.util.Locale getLocale()
      • rawFormatter

        public org.joda.time.format.DateTimeFormatter rawFormatter()
      • createFormatter

        public org.joda.time.format.DateTimeFormatter createFormatter​(com.fasterxml.jackson.databind.SerializerProvider ctxt)
      • createFormatterWithLocale

        public org.joda.time.format.DateTimeFormatter createFormatterWithLocale​(com.fasterxml.jackson.databind.SerializerProvider ctxt)
      • createParser

        public org.joda.time.format.DateTimeFormatter createParser​(com.fasterxml.jackson.databind.DeserializationContext ctxt)
        Accessor used during deserialization.
      • shouldAdjustToContextTimeZone

        public boolean shouldAdjustToContextTimeZone​(com.fasterxml.jackson.databind.DeserializationContext ctxt)
        Since:
        2.8
      • shouldWriteWithZoneId

        public boolean shouldWriteWithZoneId​(com.fasterxml.jackson.databind.SerializerProvider ctxt)
        Since:
        2.8
      • isTimezoneExplicit

        public boolean isTimezoneExplicit()
        Differentiate if TimeZone is specified by caller
        Returns:
        true if TimeZone is specified by caller; false otherwise.
      • _isStyle

        protected static boolean _isStyle​(java.lang.String formatStr)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • useTimestamp

        public boolean useTimestamp​(com.fasterxml.jackson.databind.SerializerProvider provider,
                                    com.fasterxml.jackson.databind.SerializationFeature feat)