use of com.serotonin.json.type.ObjectTypeWriter in project ma-core-public by infiniteautomation.
the class JsonSerializableUtility method convertMapToJsonObject.
/**
*/
public static JsonObject convertMapToJsonObject(Map<String, Object> map) throws JsonException {
JsonTypeWriter typeWriter = new JsonTypeWriter(Common.JSON_CONTEXT);
ObjectTypeWriter writer = new ObjectTypeWriter(typeWriter);
Iterator<String> it = map.keySet().iterator();
while (it.hasNext()) {
String name = it.next();
writer.writeEntry(name, map.get(name));
}
return writer.getJsonObject();
}
Aggregations