public TypeContext writeOpenObject() { if (prettyPrint) { TypeContext currentTypeContext= peekTypeContext(); if (currentTypeContext != null && currentTypeContext.getBasicType() == BasicType.ARRAY) { writeIndent(); } } TypeContext typeContext= new TypeContext(BasicType.OBJECT); pushTypeContext(typeContext); out.write("{"); if (prettyPrint) { indent+= 4; out.write("\n"); } return typeContext; }
public TypeContext writeOpenArray() { if (prettyPrint) { TypeContext currentTypeContext= peekTypeContext(); if (currentTypeContext != null && currentTypeContext.getBasicType() == BasicType.ARRAY) { writeIndent(); } } TypeContext typeContext= new TypeContext(BasicType.ARRAY); pushTypeContext(typeContext); out.write("["); if (prettyPrint) { indent+= 4; out.write("\n"); } return typeContext; }