Interface JsonMapper


public interface JsonMapper
Deserializes JSON to Java objects, and serializes Java objects to JSON. Implement this interface and JsonConfig.setJsonMapper(JsonMapper) it to be able to convert objects to/from JSON between your application and database. jdbi3-jackson2 and jdbi3-gson2 are readily available for this.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    forType(Type type, org.jdbi.v3.core.config.ConfigRegistry config)
     
    default Object
    fromJson(Type type, String json, org.jdbi.v3.core.config.ConfigRegistry config)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default String
    toJson(Type type, Object value, org.jdbi.v3.core.config.ConfigRegistry config)
    Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • toJson

      @Deprecated(since="3.40.0", forRemoval=true) default String toJson(Type type, Object value, org.jdbi.v3.core.config.ConfigRegistry config)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • fromJson

      @Deprecated(since="3.40.0", forRemoval=true) default Object fromJson(Type type, String json, org.jdbi.v3.core.config.ConfigRegistry config)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • forType

      JsonMapper.TypedJsonMapper forType(Type type, org.jdbi.v3.core.config.ConfigRegistry config)