/** * object begin. * * @return this. * @throws IOException. */ public JSONWriter objectBegin() throws IOException { beforeValue(); mWriter.write(JSON.LBRACE); mStack.push(mState); mState = new State(OBJECT); return this; }
/** * array begin. * * @return this. * @throws IOException. */ public JSONWriter arrayBegin() throws IOException { beforeValue(); mWriter.write(JSON.LSQUARE); mStack.push(mState); mState = new State(ARRAY); return this; }
/** * object end. * * @return this. * @throws IOException. */ public JSONWriter objectEnd() throws IOException { mWriter.write(JSON.RBRACE); mState = mStack.pop(); return this; }
/** * array end, return array value. * * @return this. * @throws IOException. */ public JSONWriter arrayEnd() throws IOException { mWriter.write(JSON.RSQUARE); mState = mStack.pop(); return this; }