public interface JsonObject
public class MyCustomPojo implements JsonObject {
public void serialize(JsonWriter writer, boolean minimal) {
//implement serialization logic, eg: writer.writeAscii("{\"my\":\"object\"}");
}
public static final JsonReader.ReadJsonObject<MyCustomPojo> JSON_READER = new JsonReader.ReadJsonObject<MyCustomPojo>() {
public MyCustomPojo deserialize(JsonReader reader) throws IOException {
//implement deserialization logic, eg: return new MyCustomPojo();
}
}
}
| Modifier and Type | Method and Description |
|---|---|
void |
serialize(JsonWriter writer,
boolean minimal)
Serialize object instance into JsonWriter.
|
void serialize(JsonWriter writer, boolean minimal)
writer - write JSON into target writerminimal - is minimal serialization requestedCopyright © 2023. All rights reserved.