MCPcopy Create free account
hub / github.com/MCBans/MCBans / append

Method append

src/main/java/com/mcbans/plugin/org/json/JSONWriter.java:110–130  ·  view source on GitHub ↗

Append a value. @param string A string value. @return this @throws JSONException If the value is out of sequence.

(String string)

Source from the content-addressed store, hash-verified

108 * @throws JSONException If the value is out of sequence.
109 */
110 private JSONWriter append(String string) throws JSONException {
111 if (string == null) {
112 throw new JSONException("Null pointer");
113 }
114 if (this.mode == 'o' || this.mode == 'a') {
115 try {
116 if (this.comma && this.mode == 'a') {
117 this.writer.write(',');
118 }
119 this.writer.write(string);
120 } catch (IOException e) {
121 throw new JSONException(e);
122 }
123 if (this.mode == 'o') {
124 this.mode = 'k';
125 }
126 this.comma = true;
127 return this;
128 }
129 throw new JSONException("Value out of sequence.");
130 }
131
132 /**
133 * Begin appending a new array. All values until the balancing

Callers 3

arrayMethod · 0.95
objectMethod · 0.95
valueMethod · 0.95

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected