T - Type of the read objectpublic interface ObjectReader<T>
To generate an implementation, use GWT.create(Class).
Example :
public class Person {
public String firstName, lastName;
}
public interface PersonReader extends ObjectReader<Person> {}
PersonReader reader = GWT.create(PersonReader.class);
Person person = reader.read("{\"firstName\":\"Nicolas\",\"lastName\":\"Morel\"}");
person.firstName ==> "Nicolas"
person.lastName ==> "Morel"
| Modifier and Type | Method and Description |
|---|---|
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 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 inputCopyright © 2017. All Rights Reserved.