RM-1764 (Simplified Relationship View)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@90782 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-11-19 21:04:31 +00:00
parent 71adb61ba3
commit 1f9a397aad
5 changed files with 238 additions and 0 deletions

View File

@@ -295,4 +295,28 @@ public final class WebScriptUtils
return value;
}
/**
* Creates a json object from the given {@link String}
*
* @param json The json object as {@link String}
* @return The json object created from the given {@link String}
*/
public static JSONObject createJSONObject(String json)
{
mandatory("json", json);
JSONObject jsonObject;
try
{
jsonObject = new JSONObject(json);
}
catch (JSONException error)
{
throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Cannot create a json object from the given string '" + json + "'.", error);
}
return jsonObject;
}
}