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

write() — spring-boot Function Reference

Architecture documentation for the write() function in JsonMarshaller.java from the spring-boot codebase.

Function java GradlePlugin RunTasks calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  3014ae9a_c9f1_fb77_0ef5_e1420502c97c["write()"]
  c4118607_52d6_4803_5116_d02d56489a1f["writeMetadata()"]
  c4118607_52d6_4803_5116_d02d56489a1f -->|calls| 3014ae9a_c9f1_fb77_0ef5_e1420502c97c
  e1a961a5_5d30_98e5_6d30_a9fece427ef0["asBytes()"]
  e1a961a5_5d30_98e5_6d30_a9fece427ef0 -->|calls| 3014ae9a_c9f1_fb77_0ef5_e1420502c97c
  135fcb76_5f4d_6bcf_4ec3_690e10d8d879["JSONObject()"]
  3014ae9a_c9f1_fb77_0ef5_e1420502c97c -->|calls| 135fcb76_5f4d_6bcf_4ec3_690e10d8d879
  0fcb93b3_4873_3258_b9e6_29138d183448["put()"]
  3014ae9a_c9f1_fb77_0ef5_e1420502c97c -->|calls| 0fcb93b3_4873_3258_b9e6_29138d183448
  84069be6_cab7_e044_39c5_1f7f522d5c01["toString()"]
  3014ae9a_c9f1_fb77_0ef5_e1420502c97c -->|calls| 84069be6_cab7_e044_39c5_1f7f522d5c01
  style 3014ae9a_c9f1_fb77_0ef5_e1420502c97c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshaller.java lines 47–66

	public void write(ConfigurationMetadata metadata, OutputStream outputStream) throws IOException {
		try {
			JSONObject object = new JSONObject();
			JsonConverter converter = new JsonConverter();
			object.put("groups", converter.toJsonArray(metadata, ItemType.GROUP));
			object.put("properties", converter.toJsonArray(metadata, ItemType.PROPERTY));
			object.put("hints", converter.toJsonArray(metadata.getHints()));
			object.put("ignored", converter.toJsonObject(metadata.getIgnored()));
			outputStream.write(object.toString(2).getBytes(StandardCharsets.UTF_8));
		}
		catch (Exception ex) {
			if (ex instanceof IOException ioException) {
				throw ioException;
			}
			if (ex instanceof RuntimeException runtimeException) {
				throw runtimeException;
			}
			throw new IllegalStateException(ex);
		}
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does write() do?
write() is a function in the spring-boot codebase.
What does write() call?
write() calls 3 function(s): JSONObject, put, toString.
What calls write()?
write() is called by 2 function(s): asBytes, writeMetadata.

Analyze Your Own Codebase

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

Try Supermodel Free