Class DoclingServeJackson2Client

java.lang.Object
ai.docling.serve.client.DoclingServeClient
ai.docling.serve.client.DoclingServeJackson2Client
All Implemented Interfaces:
ai.docling.serve.api.DoclingServeApi

public class DoclingServeJackson2Client extends DoclingServeClient
A specialized implementation of DoclingServeClient that integrates with the Jackson library for JSON serialization and deserialization using JsonMapper.

This client provides methods to convert objects to JSON strings and parse JSON strings into Java objects, leveraging the capabilities of Jackson's JsonMapper.

Instances of this client can be created through the DoclingServeJackson2Client.Builder by configuring properties such as the JsonMapper.Builder.

  • Method Details

    • toBuilder

    • readValue

      protected <T> T readValue(String json, Class<T> valueType)
      Description copied from class: DoclingServeClient
      Reads and deserializes the given JSON string into an instance of the specified type.
      Specified by:
      readValue in class DoclingServeClient
      Type Parameters:
      T - the type of the object to be deserialized
      Parameters:
      json - the JSON string to deserialize; must not be null
      valueType - the Class of the target type; must not be null
      Returns:
      an instance of T deserialized from the provided JSON
    • writeValueAsString

      protected <T> String writeValueAsString(T value)
      Description copied from class: DoclingServeClient
      Serializes the given object into its JSON string representation.
      Specified by:
      writeValueAsString in class DoclingServeClient
      Type Parameters:
      T - the type of the object to serialize
      Parameters:
      value - the object to serialize; must not be null
      Returns:
      the JSON string representation of the given object