GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Processing
  • Download
  • Reference
  • Environment
  • Libraries
  • Tools
  • Wiki
  • Tutorials
  • Examples
  • Books
  • Forum
  • Overview
  • People
  • Privacy

This view

  • Original page
  • New address

GeezerVison is showing processing.org — setJSONObject() / Reference

Reference+
Documentation→Reference→Data→Composite→JSONObject

Name

setJSONObject()

Class

JSONObject

Description

Sets the value of the JSONObject with the associated key.

Examples

  • JSONObject json;
    
    void setup() {
    
      json = new JSONObject();
    
      JSONObject lion = new JSONObject();
      lion.setInt("id", 0);
      lion.setString("species", "Panthera leo");
    
      json.setJSONObject("lion", lion);
    
      println(json);
    }
    
    // Sketch prints:
    // {"lion": {
    //   "id": 0,
    //   "species": "Panthera leo"
    // }}
    

Syntax

  • .setJSONObject(key, value)

Parameters

  • key(String)a key string
  • value(JSONObject)value to assign

Return

  • JSONObject

Related

  • JSONObject::setJSONArray()
  • JSONObject::getJSONObject()
  • JSONObject::getJSONArray()
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.