Interface JacksonObjectReader

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JacksonObjectReader
Defines the contract for Object Mapping readers. Implementations of this interface can deserialize a given byte array holding JSON to an Object considering the target type.

Reader functions can customize how the actual JSON is being deserialized by e.g. obtaining a customized ObjectReader applying serialization features, date formats, or views.

Since:
3.0
Author:
Mark Paluch
  • Method Summary

    Modifier and Type
    Method
    Description
    Create a default JacksonObjectReader delegating to ObjectMapper.readValue(InputStream, JavaType).
    read(com.fasterxml.jackson.databind.ObjectMapper mapper, byte[] source, com.fasterxml.jackson.databind.JavaType type)
    Read an object graph from the given root JSON into a Java object considering the JavaType.
  • Method Details

    • read

      Object read(com.fasterxml.jackson.databind.ObjectMapper mapper, byte[] source, com.fasterxml.jackson.databind.JavaType type) throws IOException
      Read an object graph from the given root JSON into a Java object considering the JavaType.
      Parameters:
      mapper - the object mapper to use.
      source - the JSON to deserialize.
      type - the Java target type
      Returns:
      the deserialized Java object.
      Throws:
      IOException - if an I/O error or JSON deserialization error occurs.
    • create

      static JacksonObjectReader create()
      Create a default JacksonObjectReader delegating to ObjectMapper.readValue(InputStream, JavaType).
      Returns:
      the default JacksonObjectReader.