Package org.json

Examples of org.json.JSONStringer.endArray()


            {
               json.key("description").value(nd.getDescription());
            }
            json.endObject();
         }
         json.endArray().key("operations").array();
         for (NamedDescription nd : model.getOperations())
         {
            json.object().key("operation-name").value(nd.getName()).key("operation-description").value(nd.getDescription()).endObject();
         }
         json.endArray().endObject();
View Full Code Here


         json.endArray().key("operations").array();
         for (NamedDescription nd : model.getOperations())
         {
            json.object().key("operation-name").value(nd.getName()).key("operation-description").value(nd.getDescription()).endObject();
         }
         json.endArray().endObject();

         printWriter.write(new JSONObject(json.toString()).toString(3));
         printWriter.flush();
      }
      catch (JSONException e)
View Full Code Here

            if (lVal instanceof Collection) {
              jsonStringer.key(lKey).array();
              for (Object item : (Collection) lVal) {
                jsonStringer.value(item);
              }
              jsonStringer.endArray();
            } else {
              jsonStringer.key(lKey).value(lVal);
            }
          }
          // end main object
View Full Code Here

            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();
    }

    /**
     * Returns the handle for the midi device with the specified index. The
View Full Code Here

        json.array();
        for (final Receiver receiver : device.getReceivers())
        {
            json.value(System.identityHashCode(receiver));
        }
        json.endArray();
        return json.toString();
    }

    /**
     * Returns MIDI IN transmitter for the specified device. A transmitter must
View Full Code Here

        json.array();
        for (final Transmitter transmitter : device.getTransmitters())
        {
            json.value(System.identityHashCode(transmitter));
        }
        json.endArray();
        return json.toString();
    }

    /**
     * Sends a MIDI message to a receiver.
View Full Code Here

            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);
            json.endArray();
            if (message instanceof ShortMessage)
                processShortMessage((ShortMessage) message, json);
            else if (message instanceof MetaMessage)
                processMetaMessage((MetaMessage) message, json);
            else if (message instanceof SysexMessage)
View Full Code Here

            {
               json.key("description").value(nd.getDescription());
            }
            json.endObject();
         }
         json.endArray().key("operations").array();
         for (NamedDescription nd : model.getOperations())
         {
            json.object().key("operation-name").value(nd.getName()).key("operation-description").value(nd.getDescription()).endObject();
         }
         json.endArray().endObject();
View Full Code Here

         json.endArray().key("operations").array();
         for (NamedDescription nd : model.getOperations())
         {
            json.object().key("operation-name").value(nd.getName()).key("operation-description").value(nd.getDescription()).endObject();
         }
         json.endArray().endObject();

         JSONObject output = new JSONObject(json.toString());
         if (pretty)
         {
            printWriter.write(output.toString(3));
View Full Code Here

            stringer.key(Members.EXECUTE_LIST.name()).array();
            for (AbstractPlanNode node : m_list) {
                stringer.value(node.getPlanNodeId().intValue());
            }
            stringer.endArray(); //end execution list

            stringer.endObject(); //end PlanNodeList
        } catch (JSONException e) {
            // HACK ugly ugly to make the JSON handling
            // in QueryPlanner generate a JSONException for a plan we know
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.