Examples of writeEndObject()


Examples of org.codehaus.jackson.JsonGenerator.writeEndObject()

        g.writeRaw("\n    ");
        g.writeEndObject();

      }
      g.writeRaw("\n  ");
      g.writeEndObject(); // for mapFields

      byte[] rawPayload = record.getRawPayload();
      if (rawPayload != null && rawPayload.length > 0) {
        // write rawPayload
        g.writeRaw("\n  ");
View Full Code Here

Examples of org.codehaus.jackson.JsonGenerator.writeEndObject()

        g.writeRaw("\n  ");
        g.writeStringField("rawPayload", Base64.encode(rawPayload, false));
      }

      g.writeRaw("\n");
      g.writeEndObject(); // for whole znrecord

      // important: will force flushing of output, close underlying output
      // stream
      g.close();
    } catch (Exception e) {
View Full Code Here

Examples of org.codehaus.jackson.JsonGenerator.writeEndObject()

                }
            }

            generator.writeEndArray();

            generator.writeEndObject();
            generator.close();

            final JSONPObject object = new JSONPObject(callback, out.toString());
            return Response.ok(object).build();
        }
View Full Code Here

Examples of org.codehaus.jackson.JsonGenerator.writeEndObject()

      g.writeFieldName("partId");
      g.writeNumber(Integer.valueOf(e.getPartitionId()));

      g.writeFieldName(VALUE_FIELD_NAME);
      writer.write(datum, new JsonEncoder(schema, g));
      g.writeEndObject();
      g.writeEndObject();
      try {
        g.writeEndObject();
      }
      catch (JsonGenerationException e_json) {
View Full Code Here

Examples of org.codehaus.jackson.JsonGenerator.writeEndObject()

      g.writeNumber(Integer.valueOf(e.getPartitionId()));

      g.writeFieldName(VALUE_FIELD_NAME);
      writer.write(datum, new JsonEncoder(schema, g));
      g.writeEndObject();
      g.writeEndObject();
      try {
        g.writeEndObject();
      }
      catch (JsonGenerationException e_json) {
        // ignore the error as some how avro JsonEncoder may some times missing two }
View Full Code Here

Examples of org.codehaus.jackson.JsonGenerator.writeEndObject()

      g.writeFieldName(VALUE_FIELD_NAME);
      writer.write(datum, new JsonEncoder(schema, g));
      g.writeEndObject();
      g.writeEndObject();
      try {
        g.writeEndObject();
      }
      catch (JsonGenerationException e_json) {
        // ignore the error as some how avro JsonEncoder may some times missing two }
      }
      g.flush();
View Full Code Here

Examples of org.codehaus.jackson.JsonGenerator.writeEndObject()

          writeJSON_V1(g,encoding);
        } else {
          writeJSON_V2(g,encoding);
        }

        g.writeEndObject();
        g.flush();
        baos.write("\n".getBytes(Charset.defaultCharset()));
      } catch (IOException e) {
        LOG.error("JSON write error: " + e.getMessage(), e);
      }
View Full Code Here

Examples of org.codehaus.jackson.util.TokenBuffer.writeEndObject()

        // Ok, first test JSON Object containing buffer:
        TokenBuffer buf = new TokenBuffer(mapper);
        buf.writeStartObject();
        buf.writeNumberField("num", 42);
        buf.writeEndObject();
        String json = mapper.writeValueAsString(new ObjectHolder(buf));
        ObjectHolder holder = mapper.readValue(json, ObjectHolder.class);
        assertNotNull(holder.value);
        assertSame(TokenBuffer.class, holder.value.getClass());
        JsonParser jp = ((TokenBuffer) holder.value).asParser();
View Full Code Here

Examples of org.elasticsearch.common.jackson.core.JsonGenerator.writeEndObject()

          generator.writeEndArray();
        } else {
          generator.writeObjectField(value.getName(), value.getValue());
        }
      }
      generator.writeEndObject();
      generator.flush();
      return new String(stream.toByteArray(), Charset.forName("UTF-8"));
    } catch (IOException e) {
      return null;
    }
View Full Code Here

Examples of org.elasticsearch.common.xcontent.XContentGenerator.writeEndObject()

        jsonGen.writeNull();
        xsonGen.writeEndArray();
        jsonGen.writeEndArray();

        xsonGen.writeEndObject();
        jsonGen.writeEndObject();

        xsonGen.close();
        jsonGen.close();

        verifySameTokens(XContentFactory.xContent(XContentType.JSON).createParser(jsonOs.copiedByteArray()), XContentFactory.xContent(XContentType.SMILE).createParser(xsonOs.copiedByteArray()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.