Begin appending a new object. All keys and values until the balancing endObject will be appended to this object. The endObject method must be called to mark the object's end. @return this @throws JSONException If the nesting is too deep, or if the object is started in the w
()
| 231 | * outermost array or object). |
| 232 | */ |
| 233 | public JSONWriter object() throws JSONException { |
| 234 | if (this.mode == 'i') { |
| 235 | this.mode = 'o'; |
| 236 | } |
| 237 | if (this.mode == 'o' || this.mode == 'a') { |
| 238 | this.append("{"); |
| 239 | this.push(new JSONObject()); |
| 240 | this.comma = false; |
| 241 | return this; |
| 242 | } |
| 243 | throw new JSONException("Misplaced object."); |
| 244 | |
| 245 | } |
| 246 | |
| 247 | |
| 248 | /** |