Class NullKeySerializer

java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<Object>
cool.scx.common.jackson.NullKeySerializer
All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable

public class NullKeySerializer extends com.fasterxml.jackson.databind.JsonSerializer<Object>
针对 HashMap 中可能出现的 null key 这里做特殊处理
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer

    com.fasterxml.jackson.databind.JsonSerializer.None
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final NullKeySerializer
    默认的 NullKey 序列化器
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    serialize(Object value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers)
     

    Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

    acceptJsonFormatVisitor, getDelegatee, handledType, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties

    Methods inherited from class java.lang.Object

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

    • NULL_KEY_SERIALIZER

      public static final NullKeySerializer NULL_KEY_SERIALIZER
      默认的 NullKey 序列化器
  • Constructor Details

    • NullKeySerializer

      public NullKeySerializer(String nullKey)
  • Method Details

    • serialize

      public void serialize(Object value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers) throws IOException
      Specified by:
      serialize in class com.fasterxml.jackson.databind.JsonSerializer<Object>
      Throws:
      IOException