wrap() — spring-boot Function Reference
Architecture documentation for the wrap() function in JSONObject.java from the spring-boot codebase.
Entity Profile
Dependency Diagram
graph TD 83ab2fca_174b_168b_1e36_dc2704a08e65["wrap()"] d1e7d664_bbd8_b5f8_928b_bef69f5b5ce1["JSONObject()"] d1e7d664_bbd8_b5f8_928b_bef69f5b5ce1 -->|calls| 83ab2fca_174b_168b_1e36_dc2704a08e65 d1e7d664_bbd8_b5f8_928b_bef69f5b5ce1["JSONObject()"] 83ab2fca_174b_168b_1e36_dc2704a08e65 -->|calls| d1e7d664_bbd8_b5f8_928b_bef69f5b5ce1 73772166_be2f_6e41_7132_c7cc2d941d4a["toString()"] 83ab2fca_174b_168b_1e36_dc2704a08e65 -->|calls| 73772166_be2f_6e41_7132_c7cc2d941d4a style 83ab2fca_174b_168b_1e36_dc2704a08e65 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONObject.java lines 800–834
@SuppressWarnings("rawtypes")
public static Object wrap(Object o) {
if (o == null) {
return NULL;
}
if (o instanceof JSONArray || o instanceof JSONObject) {
return o;
}
if (o.equals(NULL)) {
return o;
}
try {
if (o instanceof Collection) {
return new JSONArray((Collection) o);
}
else if (o.getClass().isArray()) {
return new JSONArray(o);
}
if (o instanceof Map) {
return new JSONObject((Map) o);
}
if (o instanceof Boolean || o instanceof Byte || o instanceof Character || o instanceof Double
|| o instanceof Float || o instanceof Integer || o instanceof Long || o instanceof Short
|| o instanceof String) {
return o;
}
if (o.getClass().getPackage().getName().startsWith("java.")) {
return o.toString();
}
}
catch (Exception ex) {
// Ignore
}
return null;
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does wrap() do?
wrap() is a function in the spring-boot codebase.
What does wrap() call?
wrap() calls 2 function(s): JSONObject, toString.
What calls wrap()?
wrap() is called by 1 function(s): JSONObject.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free