Class JsonSerialiser
java.lang.Object
info.oais.implementation.infomodel.JsonSerialiser
public class JsonSerialiser extends Object
JsonSerialiser - to keep all code in one place.
Usage: when the object on is to be serialised as JSON then
js = new JsonSerialiser();
JSONObject jo = new JSONObject();
js.addElement(jo, obj);
String str = jo.toJSONString();
Then write out str.
js = new JsonSerialiser();
JSONObject jo = new JSONObject();
js.addElement(jo, obj);
String str = jo.toJSONString();
Then write out str.
- Author:
- David
-
Constructor Summary
Constructors Constructor Description JsonSerialiser()
JsonSerialiser constructor -
Method Summary
Modifier and Type Method Description org.json.simple.JSONObject
addElement(org.json.simple.JSONObject jo, Object ob)
Add JSON components
-
Constructor Details
-
JsonSerialiser
public JsonSerialiser()JsonSerialiser constructor
-
-
Method Details
-
addElement
Add JSON components- Parameters:
jo
- The JSONObject to which to addob
- Object to be serialised- Returns:
- The JSONObject
-