T - Type of the read objectpublic interface ObjectReader<T>
Example :
public class Person {
public String firstName, lastName;
}
public interface PersonReader extends ObjectReader<Person> {}
PersonReader reader = new PersonReaderMapperImpl();
Person person = reader.read("{\"firstName\":\"Nicolas\",\"lastName\":\"Morel\"}");
person.firstName ==> "Nicolas"
person.lastName ==> "Morel"
| Modifier and Type | Method and Description |
|---|---|
JsonDeserializer<T> |
getDeserializer()
getDeserializer.
|
T |
read(String input)
Reads a JSON input into an object.
|
T |
read(String input,
JsonDeserializationContext ctx)
Reads a JSON input into an object.
|
T[] |
readArray(String input,
ArrayJsonDeserializer.ArrayCreator<T> arrayCreator)
Reads a JSON input into an array object.
|
T[] |
readArray(String input,
JsonDeserializationContext ctx,
ArrayJsonDeserializer.ArrayCreator<T> arrayCreator)
Reads a JSON input into an array object.
|
T read(String input) throws JsonDeserializationException
input - JSON input to readJsonDeserializationException - if an exception occurs while reading the inputT read(String input, JsonDeserializationContext ctx) throws JsonDeserializationException
input - JSON input to readctx - Context for the full reading processJsonDeserializationException - if an exception occurs while reading the inputT[] readArray(String input, ArrayJsonDeserializer.ArrayCreator<T> arrayCreator) throws JsonDeserializationException
input - JSON input to readarrayCreator - Creator for initializing new instance of an array of specific lengthJsonDeserializationException - if an exception occurs while reading the inputT[] readArray(String input, JsonDeserializationContext ctx, ArrayJsonDeserializer.ArrayCreator<T> arrayCreator) throws JsonDeserializationException
input - JSON input to readctx - Context for the full reading processarrayCreator - Creator for initializing new instance of an array of specific lengthJsonDeserializationException - if an exception occurs while reading the inputJsonDeserializer<T> getDeserializer()
getDeserializer.
JsonDeserializer object.Copyright © 2020. All rights reserved.