JSONObject jscontent = new JSONObject();
if(entry.getContentElement() != null) {
Content content = entry.getContentElement();
Type type = entry.getContentType();
if (type.equals(Content.Type.HTML) ||
type.equals(Content.Type.XHTML) ||
type.equals(Content.Type.TEXT)) {
jscontent.put("type", type.toString());
} else {
jscontent.put("type", content.getMimeType().toString());
}
jscontent.put("value", content.getValue());
jsentry.put("content", jscontent);