Package org.json

Examples of org.json.JSONStringer.endObject()


            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())
         {
            json.object().key("operation-name").value(nd.getName()).key("operation-description").value(nd.getDescription()).endObject();
View Full Code Here


            } else {
              jsonStringer.key(lKey).value(lVal);
            }
          }
          // end main object
          jsonStringer.endObject();
          lData = jsonStringer.toString();
        } catch (JSONException ex) {
          log.error(ex.getClass().getSimpleName() + ": " + ex.getMessage());
        }
        lBCT.put("value", lData);
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

                processShortMessage((ShortMessage) message, json);
            else if (message instanceof MetaMessage)
                processMetaMessage((MetaMessage) message, json);
            else if (message instanceof SysexMessage)
                processSysexMessage((SysexMessage) message, json);
            json.endObject();
            this.applet.execJSMethod("messageReceived",
                System.identityHashCode(this),
                json.toString(), timeStamp);
        }
        catch (final JSONException e)
View Full Code Here

            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())
         {
            json.object().key("operation-name").value(nd.getName()).key("operation-description").value(nd.getDescription()).endObject();
View Full Code Here

    writer.key("ajax");
    ajax.toJson(writer);
      }
      Json.writeFunction(writer, "data", data);
      Json.writeFunction(writer, "tags", tags);
      writer.endObject();

      return writer.toString();
  } catch (JSONException e) {
      throw new RuntimeException("Could not convert Select2 settings object to Json", e);
  }
View Full Code Here

                    if (args[i] == null)
                        params.value( JSONObject.NULL );
                    else
                        params.value( args[i] );
                }
                json.endObject();
            } catch (JSONException e)
            {
                throw new IllegalArgumentException( "Could not create eventValue", e );
            }
View Full Code Here

                    if (args[i] == null)
                        params.value( JSONObject.NULL );
                    else
                        params.value( args[i] );
                }
                json.endObject();
            } catch (JSONException e)
            {
                throw new IllegalArgumentException( "Could not create event", e );
            }
View Full Code Here

                .equals(param.getValue())) {
                stringer.key(param.getKey()).value(param.getValue());
            }
        }

        return stringer.endObject().toString();
    }

    public static Map<String, Object> parseJSON(String jsonBody) throws JSONException {
        final Map<String, Object> params = new HashMap<String, Object>();
View Full Code Here

        JSONStringer stringer = new JSONStringer();
        try
        {
            stringer.object();
            toJSONString(stringer);
            stringer.endObject();
        }
        catch (JSONException e)
        {
            throw new RuntimeException("Failed to serialize " + this, e);
//            System.exit(-1);
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.