All Implemented Interfaces:
JsonFormatVisitable, SchemaAware, ContextualSerializer, Serializable
Direct Known Subclasses:
CalendarSerializer, DateSerializer, SqlDateSerializer

public abstract class DateTimeSerializerBase<T> extends StdScalarSerializer<T> implements ContextualSerializer
See Also:
  • Field Details

    • _useTimestamp

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

      protected final DateFormat _customFormat
      Specific format to use, if not default format: non null value also indicates that serialization is to be done as JSON String, not numeric timestamp, unless _useTimestamp is true.
    • _reusedCustomFormat

      protected final AtomicReference<DateFormat> _reusedCustomFormat
      If _customFormat is used, we will try to reuse instances in simplest possible form; thread-safe, but without overhead of ThreadLocal (not from code, but wrt retaining of possibly large number of format instances over all threads, properties with custom formats).
      Since:
      2.9
  • Constructor Details

    • DateTimeSerializerBase

      protected DateTimeSerializerBase(Class<T> type, Boolean useTimestamp, DateFormat customFormat)
  • Method Details