MCPcopy Create free account
hub / github.com/Var3D/var3dframe / put

Method put

core/src/core/java/var3d/net/center/json/VJSON.java:105–120  ·  view source on GitHub ↗

新增,修改,删除(修改所在路径的值,如果不存在则自动创建路径。如果值为null则为删除) @param jsonPath @param vaule

(String jsonPath, Object vaule)

Source from the content-addressed store, hash-verified

103 * @param vaule
104 */
105 public void put(String jsonPath, Object vaule) {
106 jsonPath = jsonPath.replaceAll("\\.", "/");
107 int id = jsonPath.lastIndexOf("/");
108 String key = jsonPath;
109 JSONObject object = jsonObj;
110 if (id != -1) {
111 key = jsonPath.substring(id + 1);
112 jsonPath = jsonPath.substring(0, id);
113 object = (JSONObject) getIt(jsonPath);
114 }
115 try {
116 object.put(key, vaule);
117 } catch (JSONException e) {
118 e.printStackTrace();
119 }
120 }
121
122 /**
123 * 修改节点名称

Callers 15

getFontMethod · 0.45
editMethod · 0.45
getStageJavaFileMethod · 0.45
getStageKotlinFileMethod · 0.45
getLineNumberMethod · 0.45
linkNativeTextFieldMethod · 0.45
getFontPixmapMethod · 0.45
linkNativeTextFieldMethod · 0.45
createMethod · 0.45
setUserDataMethod · 0.45
clearAllUIMethod · 0.45
getStageMethod · 0.45

Calls 2

getItMethod · 0.95
putMethod · 0.95

Tested by

no test coverage detected