public class JSONUtil extends Object
The structure of a JSON serialization is {name:{key0:val0,...}} where name is the name of the component e.g. client, admin, ldap,... etc. So this lets you create a JSON object that has a single JSON object as its value and directly do set/get against the value object.
Created by Jeff Gaynor
on 11/14/16 at 2:12 PM
Modifier and Type | Method and Description |
---|---|
String |
getComponentName() |
net.sf.json.JSONArray |
getJSONArray(net.sf.json.JSONObject json,
String key) |
Object |
getJSONValue(net.sf.json.JSONObject json,
String key) |
boolean |
getJSONValueBoolean(net.sf.json.JSONObject json,
String key) |
int |
getJSONValueInt(net.sf.json.JSONObject json,
String key) |
long |
getJSONValueLong(net.sf.json.JSONObject json,
String key) |
String |
getJSONValueString(net.sf.json.JSONObject json,
String key) |
boolean |
hasKey(net.sf.json.JSONObject json,
String key) |
void |
setJSONValue(net.sf.json.JSONObject json,
String key,
Object value) |
public JSONUtil(String componentName)
public String getComponentName()
public net.sf.json.JSONArray getJSONArray(net.sf.json.JSONObject json, String key)
public boolean hasKey(net.sf.json.JSONObject json, String key)
public boolean getJSONValueBoolean(net.sf.json.JSONObject json, String key)
public long getJSONValueLong(net.sf.json.JSONObject json, String key)
public int getJSONValueInt(net.sf.json.JSONObject json, String key)
Copyright © 2019. All Rights Reserved.