Class FailingSerializer

All Implemented Interfaces:
JsonFormatVisitable

public class FailingSerializer extends StdSerializer<Object>
Special bogus "serializer" that will throw DatabindException if its serialize(java.lang.Object, tools.jackson.core.JsonGenerator, tools.jackson.databind.SerializationContext) gets invoked. Most commonly registered as handler for unknown types, as well as for catching unintended usage (like trying to use null as Map/Object key).
  • Field Details

    • _msg

      protected final String _msg
  • Constructor Details

    • FailingSerializer

      public FailingSerializer(String msg)
  • Method Details

    • serialize

      public void serialize(Object value, tools.jackson.core.JsonGenerator g, SerializationContext provider) throws tools.jackson.core.JacksonException
      Description copied from class: ValueSerializer
      Method that can be called to ask implementation to serialize values of type this serializer handles.
      Specified by:
      serialize in class StdSerializer<Object>
      Parameters:
      value - Value to serialize; can not be null.
      g - Generator used to output resulting Json content
      provider - Context that can be used to get serializers for serializing Objects value contains, if any.
      Throws:
      tools.jackson.core.JacksonException