private static JSONObject fromTagToJson2(Tag tag) throws JSONException { JSONObject retval = new JSONObject(); retval.put("guid", toString(tag.getTagGUID())); retval.put("type", toString(tag.getTagType())); retval.put("name", tag.getName()); retval.put("contentsCount", tag.getContentsCount()); return retval; }