Class MatsSocketStatics.MessageToStringDeserializer

java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<Object>
io.mats3.matssocket.impl.MatsSocketStatics.MessageToStringDeserializer
All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
Enclosing interface:
MatsSocketStatics

public static class MatsSocketStatics.MessageToStringDeserializer extends com.fasterxml.jackson.databind.JsonDeserializer<Object>
A MatsSocketServer.MatsSocketEnvelopeWithMetaDto will be Deserialized (made into object) with the "msg" field directly to the JSON that is present there (i.e. a String, containing JSON), using this class. However, upon serialization, any object there will be serialized to a JSON String (UNLESS it is a MatsSocketStatics.DirectJson, in which case its value is copied in verbatim). The rationale is that upon reception, we do not (yet) know which type (DTO class) this message has, which will be resolved later - and then this JSON String will be deserialized into that specific DTO class.
  • Nested Class Summary

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

    com.fasterxml.jackson.databind.JsonDeserializer.None
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt)
     

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

    deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer

    Methods inherited from class java.lang.Object

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

    • MessageToStringDeserializer

      public MessageToStringDeserializer()
  • Method Details

    • deserialize

      public Object deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException
      Specified by:
      deserialize in class com.fasterxml.jackson.databind.JsonDeserializer<Object>
      Throws:
      IOException