Class JacksonJsonProvider

java.lang.Object
com.azure.core.serializer.json.jackson.JacksonJsonProvider
All Implemented Interfaces:
com.azure.json.JsonProvider

public class JacksonJsonProvider extends Object implements com.azure.json.JsonProvider
Jackson-based implementation of JsonProvider.
  • Constructor Details

    • JacksonJsonProvider

      public JacksonJsonProvider()
      Creates an instance of JacksonJsonProvider.
  • Method Details

    • createReader

      public com.azure.json.JsonReader createReader(byte[] json, com.azure.json.JsonOptions options) throws IOException
      Specified by:
      createReader in interface com.azure.json.JsonProvider
      Throws:
      IOException
    • createReader

      public com.azure.json.JsonReader createReader(String json, com.azure.json.JsonOptions options) throws IOException
      Specified by:
      createReader in interface com.azure.json.JsonProvider
      Throws:
      IOException
    • createReader

      public com.azure.json.JsonReader createReader(InputStream json, com.azure.json.JsonOptions options) throws IOException
      Specified by:
      createReader in interface com.azure.json.JsonProvider
      Throws:
      IOException
    • createReader

      public com.azure.json.JsonReader createReader(Reader json, com.azure.json.JsonOptions options) throws IOException
      Specified by:
      createReader in interface com.azure.json.JsonProvider
      Throws:
      IOException
    • createReader

      public com.azure.json.JsonReader createReader(JsonParser parser)
      Creates an instance of JsonReader wrapping a Jackson JsonParser.
      Parameters:
      parser - The JsonParser parsing JSON.
      Returns:
      A JsonReader wrapping the JsonParser.
      Throws:
      NullPointerException - If parser is null.
    • createWriter

      public com.azure.json.JsonWriter createWriter(OutputStream json, com.azure.json.JsonOptions options) throws IOException
      Specified by:
      createWriter in interface com.azure.json.JsonProvider
      Throws:
      IOException
    • createWriter

      public com.azure.json.JsonWriter createWriter(Writer json, com.azure.json.JsonOptions options) throws IOException
      Specified by:
      createWriter in interface com.azure.json.JsonProvider
      Throws:
      IOException
    • createWriter

      public com.azure.json.JsonWriter createWriter(JsonGenerator generator)
      Creates an instance of JsonWriter wrapping a Jackson JsonGenerator.
      Parameters:
      generator - The JsonGenerator writing JSON.
      Returns:
      A JsonWriter wrapping the JsonGenerator.
      Throws:
      NullPointerException - If generator is null.
    • getJsonSerializableDatabindModule

      public static Module getJsonSerializableDatabindModule()
      Returns a Jackson Databind Module that allows for com.azure.json implementations to handle deserialization and serialization of JsonSerializable types within a Jackson Databind context.

      Use the Module returned by this method with your instance of ObjectMapper to have Jackson Databind support JsonSerializable types.

      Returns:
      A Jackson Databind Module that handles deserialization and serialization of JsonSerializable types.