T - real type of objectpublic interface JSONMapper<T>
| Modifier and Type | Method and Description |
|---|---|
void |
componentFromJSON(Object arr,
org.json.JSONArray json,
int index)
Convert Java array component from JSON array component.
|
void |
componentToJSON(org.json.JSONArray json,
Object arr,
int index)
Convert JSON array component to Java array component.
|
Object |
createJSON(T obj)
Convert object to JSON.
|
T |
createObject(Object json)
Create object from JSON representation.
|
void |
fieldFromJSON(Object obj,
Field field,
org.json.JSONObject json)
Convert component of JSON object to field of Java object.
|
void |
fieldToJSON(org.json.JSONObject json,
Object obj,
Field field)
Convert object field to component of JSON object.
|
void |
getFromJSON(Object obj,
Method setter,
org.json.JSONObject json,
String name)
Set bean attribute from component of JSON object.
|
void |
setToJSON(org.json.JSONObject json,
String name,
Object obj,
Method getter)
Convert bean attribute to component of JSON object.
|
Object createJSON(T obj)
obj - object to be convertedT createObject(Object json)
json - JSON representation.void componentFromJSON(Object arr, org.json.JSONArray json, int index)
arr - a Java array with components of type Tjson - the JSON arrayindex - the index used to access both arraysvoid componentToJSON(org.json.JSONArray json,
Object arr,
int index)
json - the JSON arrayarr - a Java array with components of type Tindex - the index used to access both arraysvoid fieldToJSON(org.json.JSONObject json,
Object obj,
Field field)
json - the JSON objectobj - the Java objectfield - field of this Java objectvoid fieldFromJSON(Object obj, Field field, org.json.JSONObject json)
obj - the Java objectfield - field of this Java objectjson - the JSON objectvoid setToJSON(org.json.JSONObject json,
String name,
Object obj,
Method getter)
json - the JSON objectname - the attribute nameobj - the beangetter - the getter of the attributeCopyright © 2014–2015 Tomas Teubner. All rights reserved.