public interface IJsonIO
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isSimpleType(Class cls) |
static boolean |
isSimpleType(Object value) |
default void |
load(Bindings bindings)
Implement this method to control loading from the Json bindings.
|
static void |
loadFields(IJsonIO obj,
Class cls,
Bindings bindings) |
static <E extends IJsonIO> |
read(Bindings bindings) |
static <E extends IJsonIO> |
read(String tag,
Bindings bindings) |
static <E extends IJsonIO> |
readList(Bindings bindings) |
static <E extends IJsonIO> |
readList(String tag,
Bindings bindings) |
default void |
save(Bindings bindings)
Implement this method to control saving to a Json bindings.
|
static void |
saveFields(IJsonIO obj,
Class cls,
Bindings bindings) |
static <E extends IJsonIO> |
write(E obj,
Bindings bindings) |
static <E extends IJsonIO> |
write(String tag,
E obj,
Bindings bindings) |
static <E extends IJsonIO> |
writeList(String tag,
List<E> list,
Bindings bindings) |
static final String TYPE
default void load(Bindings bindings)
The bindings is just a simple map with name value pairs, which usually maps directly to your class's fields. But anything goes; you can read and write anything from/to the Bindings.
Use #read() etc. to read proper Json data.
bindings - default void save(Bindings bindings)
Basically, the bindings is a simple map where you write name/value pairs representing your class's format. Typically you save just your field values, but you can save anything you like.
Use #write(String, Object, Bindings) etc. to write proper Json data.
bindings - static boolean isSimpleType(Object value)
static boolean isSimpleType(Class cls)
Copyright © 2020. All rights reserved.