Examples of JSONObject


Examples of com.google.json.serialization.JsonObject

* Test for {@link JsonTraverser} class.
*/
public class JsonTraverserTest extends TestCase {

  private JsonObject makeChild(String property, long value) {
    JsonObject result = new JsonObject();
    result.put(property, value);
    return result;
  }
View Full Code Here

Examples of com.granule.json.JSONObject

                logger.logp(Level.FINEST, className, "transform", "Parsing the JSON and a DOM builder.");
            }

            try {
                //Get the JSON from the stream.
                JSONObject jObject = new JSONObject(JSONStream);

                //Create a new document

                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                DocumentBuilder dBuilder = dbf.newDocumentBuilder();
View Full Code Here

Examples of com.hazelcast.com.eclipsesource.json.JsonObject

        this.completedTaskCount = completedTaskCount;
    }

    @Override
    public JsonObject toJson() {
        final JsonObject root = new JsonObject();
        root.add("name", name);
        root.add("queueSize", queueSize);
        root.add("poolSize", poolSize);
        root.add("remainingQueueCapacity", remainingQueueCapacity);
        root.add("maximumPoolSize", maximumPoolSize);
        root.add("isTerminated", isTerminated);
        root.add("completedTaskCount", completedTaskCount);
        return root;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.lib.org.json.JSONObject

    JSONArray curArray = new JSONArray();

    for (int i = 0; i < learningTools.size(); i++) {

      JSONObject obj = new JSONObject();

      LearningTool currentltools = ((List<LearningTool>) learningTools)
          .get(i);

      DescriptionNode node = new SimpleDescriptionNodeFactory()
          .createNode(currentltools);

      obj.put("title", node.getTitle());
      obj.put("description", node.getDescription());
      obj.put("toolURL", node.getToolURl());
      obj.put("cost", node.getToolCost());
      obj.put("availability", node.getToolAvailability());
      obj.put("openSource", node.isOpenSource());
      obj.put("launched", node.getLaunchedTime());
      obj.put("registration", node.registration());
      obj.put("hasFeature", node.getFeatures());
      obj.put("supportedMobileDevices", node.getsupportedMobileDevice());
      obj.put("supportedOS", node.getsupportedOS());

      curArray.put(obj);

    }
    return curArray;
View Full Code Here

Examples of com.ibm.commons.util.io.json.JsonObject

    // Communities
    //
    protected void writeCommunitiesConfig(FacesContext context, UIViewRootEx2 rootEx, UISbtClient ctClient, Endpoint ctServer, String endpointName) throws IOException {
        try {
            // Create the configuration object and the corresponding script
            JsonObject semConfig = createCommunitiesSemConfig(context, ctClient, ctServer, endpointName);
            StringBuilder b = new StringBuilder(256);
            b.append("var SemTagSvcConfig=");
            JsonGenerator.toJson(JsonJavaFactory.instance,b,semConfig,true);
            b.append(";\n");
            String onInitSvcConfig = ctClient.getInitSvcConfigScript();
View Full Code Here

Examples of com.jdroid.java.json.JSONObject

      // Create a wrapped JsonObject or JsonArray
      T json = null;
      if (input.startsWith(ARRAY_PREFIX)) {
        json = (T)new JSONArray(input);
      } else {
        json = (T)new JSONObject(input);
      }
     
      // Parse the JSONObject
      return parse(json);
    } finally {
View Full Code Here

Examples of com.lgx8.gateway.json.JSONObject

          list.get(i).statusToString()
      });
      mapList.add(cellMap);
    }
    pageInfo.put("rows", mapList);
    JSONObject object = new JSONObject(pageInfo);
    jsonStr = object.toString();
    return jsonStr;
  }
View Full Code Here

Examples of com.liferay.portal.kernel.json.JSONObject

      privateLayout = true;
    }

    Map<Locale, String> nameMap = new HashMap<Locale, String>();

    JSONObject nameMapJSONObject = layoutJSONObject.getJSONObject(
      "nameMap");

    if (nameMapJSONObject != null) {
      nameMap = (Map<Locale, String>)LocalizationUtil.deserialize(
        nameMapJSONObject);

      if (!nameMap.containsKey(LocaleUtil.getDefault())) {
        Collection<String> values = nameMap.values();

        Iterator iterator = values.iterator();

        nameMap.put(LocaleUtil.getDefault(), (String)iterator.next());
      }
    }
    else {
      String name = layoutJSONObject.getString("name");

      nameMap.put(LocaleUtil.getDefault(), name);
    }

    Map<Locale, String> titleMap = new HashMap<Locale, String>();

    JSONObject titleMapJSONObject = layoutJSONObject.getJSONObject(
      "titleMap");

    if (titleMapJSONObject != null) {
      titleMap = (Map<Locale, String>)LocalizationUtil.deserialize(
        titleMapJSONObject);
View Full Code Here

Examples of com.massivecraft.mcore.xlib.gson.JsonObject

    popStack(); // array
  }

  @Override public void beginObject() throws IOException {
    expect(JsonToken.BEGIN_OBJECT);
    JsonObject object = (JsonObject) peekStack();
    stack.add(object.entrySet().iterator());
  }
View Full Code Here

Examples of com.mcbans.firestar.mcbans.org.json.JSONObject

        this.config = plugin.getConfigs();
    }

    public JSONObject get_data(String json_text) {
        try {
            return new JSONObject(json_text);
        } catch (JSONException e) {
            if (config.isDebug()) {
                e.printStackTrace();
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.