Code example for JSONStringer

Methods: endObject, key, object

0
     *             When JSON output fails. 
     */ 
    private void deviceInfo(final JSONStringer json, final Info info)
        throws JSONException 
    { 
        json.object();
        json.key("name").value(info.getName());
        json.key("description").value(info.getDescription());
        json.key("vendor").value(info.getVendor());
        json.key("version").value(info.getVersion());
        json.endObject();
    } 
 
    /** 
     * Returns an array of information objects representing the set of all MIDI 
     * devices available on the system. 
     * 
     * @return The array of information objects about all available MIDI 
     *         devices. 
     * @throws JSONException 
     *             When JSON string could not be constructed.