Home / Function/ toJSONObject() — spring-boot Function Reference

toJSONObject() — spring-boot Function Reference

Architecture documentation for the toJSONObject() function in JSONArray.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  61ee1b01_ec0a_c5ab_b8b8_b5dec7cb7dd7["toJSONObject()"]
  962a1b8e_5945_fd2e_b3a6_b6f25d6bc0b1["length()"]
  61ee1b01_ec0a_c5ab_b8b8_b5dec7cb7dd7 -->|calls| 962a1b8e_5945_fd2e_b3a6_b6f25d6bc0b1
  016b61d8_1b6e_f6fd_3e8c_64d2f59c0694["toString()"]
  61ee1b01_ec0a_c5ab_b8b8_b5dec7cb7dd7 -->|calls| 016b61d8_1b6e_f6fd_3e8c_64d2f59c0694
  214607ee_e3cb_2924_a164_78c801124e07["opt()"]
  61ee1b01_ec0a_c5ab_b8b8_b5dec7cb7dd7 -->|calls| 214607ee_e3cb_2924_a164_78c801124e07
  57fc7bc6_4ed2_792c_9f1c_55c28fa89a0b["put()"]
  61ee1b01_ec0a_c5ab_b8b8_b5dec7cb7dd7 -->|calls| 57fc7bc6_4ed2_792c_9f1c_55c28fa89a0b
  style 61ee1b01_ec0a_c5ab_b8b8_b5dec7cb7dd7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONArray.java lines 583–594

	public JSONObject toJSONObject(JSONArray names) throws JSONException {
		JSONObject result = new JSONObject();
		int length = Math.min(names.length(), this.values.size());
		if (length == 0) {
			return null;
		}
		for (int i = 0; i < length; i++) {
			String name = JSON.toString(names.opt(i));
			result.put(name, opt(i));
		}
		return result;
	}

Domain

Subdomains

Frequently Asked Questions

What does toJSONObject() do?
toJSONObject() is a function in the spring-boot codebase.
What does toJSONObject() call?
toJSONObject() calls 4 function(s): length, opt, put, toString.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free