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.
Author:
David
  • Constructor Details

    • JsonSerialiser

      public JsonSerialiser()
      JsonSerialiser constructor
  • Method Details

    • addElement

      public org.json.simple.JSONObject addElement​(org.json.simple.JSONObject jo, Object ob)
      Add JSON components
      Parameters:
      jo - The JSONObject to which to add
      ob - Object to be serialised
      Returns:
      The JSONObject