public JsonObject toJSON(){ final JsonObject rootObj = new JsonObject(); rootObj.addProperty("direction", this.direction.toString()); rootObj.add("from", this.caller.toGSON()); rootObj.add("to", this.callee.toGSON()); // Add the archive SHA1 of the OSS (not needed for the application archive, if any) if(this.getJarAnalyzerOfOss()!=null) rootObj.addProperty("archiveId", this.getJarAnalyzerOfOss().getSHA1()); // Callee arguments /*if(this.calleeArgs != null && this.calleeArgs.size()>0){ final JsonArray myArray = new JsonArray(); for(Entry<String, Serializable> entry : this.calleeArgs.entrySet()){ if (entry.getKey().contains("arg_value_")) { String argNumber = entry.getKey().substring(entry.getKey().lastIndexOf('_')+1); JsonObject jo = new JsonObject(); jo.addProperty(this.calleeArgs.get("arg_type_"+argNumber), entry.getValue().toString()); myArray.add(jo); } } rootObj.add("endPointArguments", myArray); }*/ rootObj.addProperty("source", "X2C"); return rootObj; }