comparison src/main/java/de/mpiwg/indexmeta/web/utils/JSONUtils.java @ 7:bc57f2660b0f

implementation of web service
author Jorge Urzua <jurzua@mpiwg-berlin.mpg.de>
date Fri, 12 Apr 2013 17:48:42 +0200
parents
children
comparison
equal deleted inserted replaced
5:7d231e4e86e5 7:bc57f2660b0f
1 package de.mpiwg.indexmeta.web.utils;
2
3 import org.json.JSONException;
4 import org.json.JSONObject;
5
6 import de.mpiwg.indexmeta.bo.Contextualization;
7
8 public class JSONUtils {
9
10 public static JSONObject ctx2JSON(Contextualization ctx) throws JSONException{
11 JSONObject json = new JSONObject();
12
13 json.put("comment", ctx.getComment());
14 json.put("content", ctx.getContent());
15 json.put("elementId", ctx.getElementId());
16 json.put("id", ctx.getId());
17 json.put("indexMetaId", ctx.getIndexMetaId());
18 json.put("remoteId", ctx.getRemoteId());
19 json.put("state", ctx.getState());
20 json.put("type", ctx.getType());
21 json.put("xpath", ctx.getXpath());
22
23 return json;
24 }
25
26 }