Class SqlDateSerializer

java.lang.Object
tools.jackson.databind.ValueSerializer<Date>
tools.jackson.databind.ser.std.StdSerializer<Date>
org.tailormap.api.configuration.SqlDateSerializer
All Implemented Interfaces:
tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable

@JacksonComponent public class SqlDateSerializer extends tools.jackson.databind.ser.std.StdSerializer<Date>
Serializes a Date as an ISO date without a time, for example "2026-10-21".

GeoTools returns the values of date database columns as Date, and the features API passes them to Jackson unchanged. Jackson 2 serialized a java.sql.Date with toString() as a date only. Jackson 3 serializes it like a Date, as a timestamp in UTC (for example "2026-10-21T00:00:00.000Z"), which the viewer does not accept for date fields. When the JVM time zone is not UTC that timestamp can even fall on the previous day. Jackson 3 has no feature to restore the old behaviour, so this serializer does.

Date.toLocalDate() uses the JVM default time zone, the same time zone the JDBC driver used to create the java.sql.Date, so the date is the date stored in the database.

  • Nested Class Summary

    Nested classes/interfaces inherited from class tools.jackson.databind.ValueSerializer

    tools.jackson.databind.ValueSerializer.None
  • Field Summary

    Fields inherited from class tools.jackson.databind.ser.std.StdSerializer

    _handledType
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    serialize(Date value, tools.jackson.core.JsonGenerator gen, tools.jackson.databind.SerializationContext provider)
     

    Methods inherited from class tools.jackson.databind.ser.std.StdSerializer

    _neitherNull, _nonEmpty, _wrapIOFailure, acceptJsonFormatVisitor, acceptJsonFormatVisitorForBinary, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow

    Methods inherited from class tools.jackson.databind.ValueSerializer

    createContextual, getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, resolve, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withFormatOverrides, withIgnoredProperties

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SqlDateSerializer

      public SqlDateSerializer()
  • Method Details

    • serialize

      public void serialize(Date value, tools.jackson.core.JsonGenerator gen, tools.jackson.databind.SerializationContext provider) throws tools.jackson.core.JacksonException
      Specified by:
      serialize in class tools.jackson.databind.ser.std.StdSerializer<Date>
      Throws:
      tools.jackson.core.JacksonException