T
- type of the target objectpublic class JacksonJsonObjectReader<T> extends java.lang.Object implements JsonObjectReader<T>
JsonObjectReader
based on
Jackson.Constructor and Description |
---|
JacksonJsonObjectReader(java.lang.Class<? extends T> itemType)
Create a new
JacksonJsonObjectReader instance. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the input resource.
|
void |
open(org.springframework.core.io.Resource resource)
Open the Json resource for reading.
|
T |
read()
Read the next object in the Json resource if any.
|
void |
setMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
Set the object mapper to use to map Json objects to domain objects.
|
public JacksonJsonObjectReader(java.lang.Class<? extends T> itemType)
JacksonJsonObjectReader
instance.itemType
- the target item typepublic void setMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
mapper
- the object mapper to usepublic void open(org.springframework.core.io.Resource resource) throws java.lang.Exception
JsonObjectReader
open
in interface JsonObjectReader<T>
resource
- the input resourcejava.lang.Exception
- if unable to open the resource@Nullable public T read() throws java.lang.Exception
JsonObjectReader
read
in interface JsonObjectReader<T>
null
if the resource is exhaustedjava.lang.Exception
- if unable to read the next objectpublic void close() throws java.lang.Exception
JsonObjectReader
close
in interface JsonObjectReader<T>
java.lang.Exception
- if unable to close the input resource