Examples of writeStartObject()


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

                            g.writeStartObject();
                            g.writeFieldName(cfEntry.getKey());
                            g.writeStartArray();
                            for (Map.Entry<String, String> asEntry : cfEntry.getValue().entrySet())
                            {
                                g.writeStartObject();
                                g.writeStringField(asEntry.getKey(), asEntry.getValue());
                                g.writeEndObject();
                            }
                            g.writeEndArray();
                            g.writeEndObject();
View Full Code Here

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

        JsonFactory f = new JsonFactory();
        try
        {
            JsonGenerator g = f.createJsonGenerator(tmpFile, JsonEncoding.UTF8);
            g.useDefaultPrettyPrinter();
            g.writeStartObject();
            g.writeArrayFieldStart("generations");
            for (int level = 0; level < generations.length; level++)
            {
                g.writeStartObject();
                g.writeNumberField("generation", level);
View Full Code Here

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

            g.useDefaultPrettyPrinter();
            g.writeStartObject();
            g.writeArrayFieldStart("generations");
            for (int level = 0; level < generations.length; level++)
            {
                g.writeStartObject();
                g.writeNumberField("generation", level);
                g.writeArrayFieldStart("members");
                for (SSTableReader ssTableReader : generations[level])
                    g.writeNumber(ssTableReader.descriptor.generation);
                g.writeEndArray(); // members
View Full Code Here

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

        try
        {
            JsonGenerator g = this.jsonFactory.createJsonGenerator( stringWriter );

            g.writeStartObject();

            g.writeStringField( DirectMemoryConstants.KEY_FIELD_NAME, request.getKey() );

            g.writeBooleanField( DirectMemoryConstants.PUT_FIELD_NAME, request.isUpdate() );
View Full Code Here

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

        try
        {

            JsonGenerator g = this.jsonFactory.createJsonGenerator( stringWriter );

            g.writeStartObject();

            g.writeBooleanField( DirectMemoryConstants.FOUND_FIELD_NAME, response.isFound() );

            g.writeStringField( DirectMemoryConstants.KEY_FIELD_NAME, response.getKey() );
View Full Code Here

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

    StringWriter sw = new StringWriter();
    try {
      JsonFactory f = new JsonFactory();
      JsonGenerator g = f.createJsonGenerator(sw);

      g.writeStartObject();

      // write id field
      g.writeRaw("\n  ");
      g.writeStringField("id", record.getId());
View Full Code Here

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

    private Response buildJsonpResponse(final String attribute, final Cache<Object, Object> samples, final String callback)
    {
        try {
            final ByteArrayOutputStream out = new ByteArrayOutputStream();
            final JsonGenerator generator = objectMapper.getJsonFactory().createJsonGenerator(out);
            generator.writeStartObject();

            generator.writeFieldName("attribute");
            generator.writeString(attribute);

            generator.writeFieldName("samples");
View Full Code Here

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

      Object datum = reader.read(null, binDecoder.get());
      DatumWriter<Object> writer = new GenericDatumWriter<Object>(schema);
      JsonGenerator g = new JsonFactory().createJsonGenerator(out, JsonEncoding.UTF8);
      // write the src ID
      g.writeStartObject();
      g.writeFieldName(SRC_ID_FIELD_NAME);
      g.writeNumber(e.getSourceId());
      g.writeFieldName(OPCODE_FIELD_NAME);
      g.writeString(e.getOpcode().toString());
      g.writeFieldName("partId");
View Full Code Here

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

    {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      JsonFactory f = new JsonFactory();
      try {
        JsonGenerator g = f.createJsonGenerator(baos, JsonEncoding.UTF8);
        g.writeStartObject();
        int version = getVersion();
        if (version == DbusEventFactory.DBUS_EVENT_V1)
        {
          writeJSON_V1(g,encoding);
        } else {
View Full Code Here

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

   */
  public static void dumpConfiguration(Configuration config,
      Writer out) throws IOException {
    JsonFactory dumpFactory = new JsonFactory();
    JsonGenerator dumpGenerator = dumpFactory.createJsonGenerator(out);
    dumpGenerator.writeStartObject();
    dumpGenerator.writeFieldName("properties");
    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
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.