Package org.json

Examples of org.json.JSONStringer.key()


      PrintWriter printWriter = new PrintWriter(outputStream);
      try
      {
         JSONStringer json = new JSONStringer();
         json.object().key("description").value(model.getDescription());
         json.key("children").array();
         for (String child : model.getChildren())
         {
            json.object().key("name").value(child);
            NamedDescription nd = model.getChildDescription(child);
            if (nd != null)
View Full Code Here


         {
            json.object().key("name").value(child);
            NamedDescription nd = model.getChildDescription(child);
            if (nd != null)
            {
               json.key("description").value(nd.getDescription());
            }
            json.endObject();
         }
         json.endArray().key("operations").array();
         for (NamedDescription nd : model.getOperations())
View Full Code Here

          Iterator<String> lIterator = sharedObjects.getKeys().iterator();
          while (lIterator.hasNext()) {
            String lKey = lIterator.next();
            Object lVal = sharedObjects.get(lKey);
            if (lVal instanceof Collection) {
              jsonStringer.key(lKey).array();
              for (Object item : (Collection) lVal) {
                jsonStringer.value(item);
              }
              jsonStringer.endArray();
            } else {
View Full Code Here

              for (Object item : (Collection) lVal) {
                jsonStringer.value(item);
              }
              jsonStringer.endArray();
            } else {
              jsonStringer.key(lKey).value(lVal);
            }
          }
          // end main object
          jsonStringer.endObject();
          lData = jsonStringer.toString();
View Full Code Here

        final JSONStringer js = new JSONStringer();
        js.array();
        for (final Info info : MidiSystem.getMidiDeviceInfo())
        {
            js.object();
            js.key("name").value(info.getName());
            js.key("description").value(info.getDescription());
            js.key("vendor").value(info.getVendor());
            js.key("version").value(info.getVersion());
            js.endObject();
        }
View Full Code Here

        js.array();
        for (final Info info : MidiSystem.getMidiDeviceInfo())
        {
            js.object();
            js.key("name").value(info.getName());
            js.key("description").value(info.getDescription());
            js.key("vendor").value(info.getVendor());
            js.key("version").value(info.getVersion());
            js.endObject();
        }
        js.endArray();
View Full Code Here

        for (final Info info : MidiSystem.getMidiDeviceInfo())
        {
            js.object();
            js.key("name").value(info.getName());
            js.key("description").value(info.getDescription());
            js.key("vendor").value(info.getVendor());
            js.key("version").value(info.getVersion());
            js.endObject();
        }
        js.endArray();
        return js.toString();
View Full Code Here

        {
            js.object();
            js.key("name").value(info.getName());
            js.key("description").value(info.getDescription());
            js.key("vendor").value(info.getVendor());
            js.key("version").value(info.getVersion());
            js.endObject();
        }
        js.endArray();
        return js.toString();
    }
View Full Code Here

    {
        try
        {
            final JSONStringer json = new JSONStringer();
            json.object();
            json.key("status").value(message.getStatus());
            json.key("message");
            json.array();
            final byte[] data = message.getMessage();
            final int max = Math.min(data.length, message.getLength());
            for (int i = 0; i < max; i++)
View Full Code Here

        try
        {
            final JSONStringer json = new JSONStringer();
            json.object();
            json.key("status").value(message.getStatus());
            json.key("message");
            json.array();
            final byte[] data = message.getMessage();
            final int max = Math.min(data.length, message.getLength());
            for (int i = 0; i < max; i++)
                json.value(data[i] & 0xff);
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.