Interface ExtensionJsonSerializer<T extends Extendable,​E extends Extension<T>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      E deserialize​(com.fasterxml.jackson.core.JsonParser jsonParser, com.fasterxml.jackson.databind.DeserializationContext deserializationContext)
      Deserializes the provided JSON to an extension of type E.
      default E deserializeAndUpdate​(com.fasterxml.jackson.core.JsonParser jsonParser, com.fasterxml.jackson.databind.DeserializationContext deserializationContext, E extension)
      Deserializes the provided JSON to update the provided extension.
      void serialize​(E extension, com.fasterxml.jackson.core.JsonGenerator jsonGenerator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider)
      Serializes the provided extension to JSON.
    • Method Detail

      • serialize

        void serialize​(E extension,
                       com.fasterxml.jackson.core.JsonGenerator jsonGenerator,
                       com.fasterxml.jackson.databind.SerializerProvider serializerProvider)
                throws IOException
        Serializes the provided extension to JSON.
        Throws:
        IOException
      • deserialize

        E deserialize​(com.fasterxml.jackson.core.JsonParser jsonParser,
                      com.fasterxml.jackson.databind.DeserializationContext deserializationContext)
               throws IOException
        Deserializes the provided JSON to an extension of type E.
        Throws:
        IOException
      • deserializeAndUpdate

        default E deserializeAndUpdate​(com.fasterxml.jackson.core.JsonParser jsonParser,
                                       com.fasterxml.jackson.databind.DeserializationContext deserializationContext,
                                       E extension)
                                throws IOException
        Deserializes the provided JSON to update the provided extension. Returns the updated extension.

        The default implementation only returns a new object as provided by deserialize(JsonParser, DeserializationContext), therefore interface implementations must provide their own implementation if they want the extension to actually be updatable from JSON.

        Throws:
        IOException