StringBuffer buf = new StringBuffer();
Iterator<String> iterator = extensionMap.keySet().iterator();
String key;
boolean first = true;
while (iterator.hasNext()){
if (!first){
buf.append(",");
}
first = false;
key = iterator.next();
buf.append("\"" + key
+ "\":" + extensionMap.get(key));
}
return "\"ext\":{"
+ buf.toString()
+ "}";