private void processTokenNormal(JsonToken token, List<TokenBuffer> result) throws IOException { this.tokenBuffer.copyCurrentEvent(this.parser); if ((token.isStructEnd() || token.isScalarValue()) && this.objectDepth == 0 && this.arrayDepth == 0) { result.add(this.tokenBuffer); this.tokenBuffer = new TokenBuffer(this.parser); } }
private void processTokenArray(JsonToken token, List<TokenBuffer> result) throws IOException { if (!isTopLevelArrayToken(token)) { this.tokenBuffer.copyCurrentEvent(this.parser); } if (this.objectDepth == 0 && (this.arrayDepth == 0 || this.arrayDepth == 1) && (token == JsonToken.END_OBJECT || token.isScalarValue())) { result.add(this.tokenBuffer); this.tokenBuffer = new TokenBuffer(this.parser); } }
private void processTokenArray(JsonToken token, List<TokenBuffer> result) throws IOException { if (!isTopLevelArrayToken(token)) { this.tokenBuffer.copyCurrentEvent(this.parser); } if (this.objectDepth == 0 && (this.arrayDepth == 0 || this.arrayDepth == 1) && (token == JsonToken.END_OBJECT || token.isScalarValue())) { result.add(this.tokenBuffer); this.tokenBuffer = new TokenBuffer(this.parser); } }
private void processTokenNormal(JsonToken token, List<TokenBuffer> result) throws IOException { this.tokenBuffer.copyCurrentEvent(this.parser); if ((token.isStructEnd() || token.isScalarValue()) && this.objectDepth == 0 && this.arrayDepth == 0) { result.add(this.tokenBuffer); this.tokenBuffer = new TokenBuffer(this.parser); } }
break; default: // others are simple: copyCurrentEvent(p);
/** * Helper method that will append contents of given buffer into this * buffer. * Not particularly optimized; can be made faster if there is need. * * @return This buffer */ public TokenBuffer append(TokenBuffer other) throws IOException, JsonGenerationException { JsonParser jp = other.asParser(); while (jp.nextToken() != null) { this.copyCurrentEvent(jp); } return this; }
/** * Helper method that will append contents of given buffer into this * buffer. * Not particularly optimized; can be made faster if there is need. * * @return This buffer */ public TokenBuffer append(TokenBuffer other) throws IOException, JsonGenerationException { JsonParser jp = other.asParser(); while (jp.nextToken() != null) { this.copyCurrentEvent(jp); } return this; }
private void processTokenNormal(JsonToken token, List<TokenBuffer> result) throws IOException { this.tokenBuffer.copyCurrentEvent(this.parser); if ((token.isStructEnd() || token.isScalarValue()) && this.objectDepth == 0 && this.arrayDepth == 0) { result.add(this.tokenBuffer); this.tokenBuffer = new TokenBuffer(this.parser); } }
private void processTokenNormal(JsonToken token, List<TokenBuffer> result) throws IOException { this.tokenBuffer.copyCurrentEvent(this.parser); if ((token.isStructEnd() || token.isScalarValue()) && this.objectDepth == 0 && this.arrayDepth == 0) { result.add(this.tokenBuffer); this.tokenBuffer = new TokenBuffer(this.parser); } }
private void processTokenArray(JsonToken token, List<TokenBuffer> result) throws IOException { if (!isTopLevelArrayToken(token)) { this.tokenBuffer.copyCurrentEvent(this.parser); } if (this.objectDepth == 0 && (this.arrayDepth == 0 || this.arrayDepth == 1) && (token == JsonToken.END_OBJECT || token.isScalarValue())) { result.add(this.tokenBuffer); this.tokenBuffer = new TokenBuffer(this.parser); } }
private void processTokenArray(JsonToken token, List<TokenBuffer> result) throws IOException { if (!isTopLevelArrayToken(token)) { this.tokenBuffer.copyCurrentEvent(this.parser); } if (this.objectDepth == 0 && (this.arrayDepth == 0 || this.arrayDepth == 1) && (token == JsonToken.END_OBJECT || token.isScalarValue())) { result.add(this.tokenBuffer); this.tokenBuffer = new TokenBuffer(this.parser); } }
@Override public void copyCurrentStructure(JsonParser jp) throws IOException, JsonProcessingException { JsonToken t = jp.getCurrentToken(); // Let's handle field-name separately first if (t == JsonToken.FIELD_NAME) { writeFieldName(jp.getCurrentName()); t = jp.nextToken(); // fall-through to copy the associated value } switch (t) { case START_ARRAY: writeStartArray(); while (jp.nextToken() != JsonToken.END_ARRAY) { copyCurrentStructure(jp); } writeEndArray(); break; case START_OBJECT: writeStartObject(); while (jp.nextToken() != JsonToken.END_OBJECT) { copyCurrentStructure(jp); } writeEndObject(); break; default: // others are simple: copyCurrentEvent(jp); } }
@Override public void copyCurrentStructure(JsonParser jp) throws IOException, JsonProcessingException { JsonToken t = jp.getCurrentToken(); // Let's handle field-name separately first if (t == JsonToken.FIELD_NAME) { writeFieldName(jp.getCurrentName()); t = jp.nextToken(); // fall-through to copy the associated value } switch (t) { case START_ARRAY: writeStartArray(); while (jp.nextToken() != JsonToken.END_ARRAY) { copyCurrentStructure(jp); } writeEndArray(); break; case START_OBJECT: writeStartObject(); while (jp.nextToken() != JsonToken.END_OBJECT) { copyCurrentStructure(jp); } writeEndObject(); break; default: // others are simple: copyCurrentEvent(jp); } }
break; default: // others are simple: copyCurrentEvent(p);
break; default: // others are simple: copyCurrentEvent(p);
break; default: // others are simple: copyCurrentEvent(jp);
break; default: // others are simple: copyCurrentEvent(jp);