Mercurial > hg > IndexMetaContextualizer
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/de/mpiwg/indexmeta/web/utils/JSONUtils.java Fri Apr 12 17:48:42 2013 +0200 @@ -0,0 +1,26 @@ +package de.mpiwg.indexmeta.web.utils; + +import org.json.JSONException; +import org.json.JSONObject; + +import de.mpiwg.indexmeta.bo.Contextualization; + +public class JSONUtils { + + public static JSONObject ctx2JSON(Contextualization ctx) throws JSONException{ + JSONObject json = new JSONObject(); + + json.put("comment", ctx.getComment()); + json.put("content", ctx.getContent()); + json.put("elementId", ctx.getElementId()); + json.put("id", ctx.getId()); + json.put("indexMetaId", ctx.getIndexMetaId()); + json.put("remoteId", ctx.getRemoteId()); + json.put("state", ctx.getState()); + json.put("type", ctx.getType()); + json.put("xpath", ctx.getXpath()); + + return json; + } + +}