MCPcopy Index your code
hub / github.com/VolmitSoftware/Adapt / append

Method append

src/main/java/com/volmit/adapt/util/JSONWriter.java:101–121  ·  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

99 * @throws JSONException If the value is out of sequence.
100 */
101 private JSONWriter append(String string) throws JSONException {
102 if (string == null) {
103 throw new JSONException("Null pointer");
104 }
105 if (this.mode == 'o' || this.mode == 'a') {
106 try {
107 if (this.comma && this.mode == 'a') {
108 this.writer.write(',');
109 }
110 this.writer.write(string);
111 } catch (IOException e) {
112 throw new JSONException(e);
113 }
114 if (this.mode == 'o') {
115 this.mode = 'k';
116 }
117 this.comma = true;
118 return this;
119 }
120 throw new JSONException("Value out of sequence.");
121 }
122
123 /**
124 * 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.65

Tested by

no test coverage detected