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.
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 TypeMethodDescriptionstatic JacksonObjectReader
create()
Create a defaultJacksonObjectReader
delegating toObjectMapper.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 theJavaType
.
-
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 theJavaType
.- 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
Create a defaultJacksonObjectReader
delegating toObjectMapper.readValue(InputStream, JavaType)
.- Returns:
- the default
JacksonObjectReader
.
-