Package org.codehaus.jackson

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


    for (Entry<String, byte[]> a : e.getAttrs().entrySet()) {
      g.writeStringField(a.getKey(), new String(a.getValue()));
    }
    g.writeEndObject();
    g.writeEndObject();
    g.writeRaw('\n');
    g.flush();
  }

  public static OutputFormatBuilder builder() {
    return new OutputFormatBuilder() {
View Full Code Here


      HttpServletResponse response) throws Exception {
    Object value = filterModel(model);
    JsonGenerator generator =
        objectMapper.getJsonFactory().createJsonGenerator(response.getOutputStream(), encoding);
    if (prefixJson) {
      generator.writeRaw("{} && ");
    }
    objectMapper.writeValue(generator, value);
  }

  /**
 
View Full Code Here

    JsonEncoding encoding = getEncoding(outputMessage.getHeaders().getContentType());
    JsonGenerator jsonGenerator =
        this.objectMapper.getJsonFactory().createJsonGenerator(outputMessage.getBody(), encoding);
    if (this.prefixJson) {
      jsonGenerator.writeRaw("{} && ");
    }
    this.objectMapper.writeValue(jsonGenerator, o);
  }

  private JsonEncoding getEncoding(MediaType contentType) {
View Full Code Here

      HttpServletResponse response) throws Exception {
    Object value = filterModel(model);
    JsonGenerator generator =
        objectMapper.getJsonFactory().createJsonGenerator(response.getOutputStream(), encoding);
    if (prefixJson) {
      generator.writeRaw("{} && ");
    }
    objectMapper.writeValue(generator, value);
  }

  /**
 
View Full Code Here

        BytesWritable bytesWritable = (BytesWritable)fieldWritables.get(geometryColumn);
        if (bytesWritable == null) {
          jsonGen.writeObjectField("geometry", null);
        } else {
          OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(bytesWritable);
          jsonGen.writeRaw(",\"geometry\":" + GeometryEngine.geometryToJson(ogcGeometry.getEsriSpatialReference(),
                                          ogcGeometry.getEsriGeometry()));
        }       
      }

      jsonGen.writeEndObject();
View Full Code Here

      JsonGenerator g = f.createJsonGenerator(sw);

      g.writeStartObject();

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

      // write simepleFields
      g.writeRaw("\n  ");
      g.writeObjectFieldStart("simpleFields");
View Full Code Here

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

      // write simepleFields
      g.writeRaw("\n  ");
      g.writeObjectFieldStart("simpleFields");
      for (String key : record.getSimpleFields().keySet())
      {
        g.writeRaw("\n    ");
        g.writeStringField(key, record.getSimpleField(key));
View Full Code Here

      // write simepleFields
      g.writeRaw("\n  ");
      g.writeObjectFieldStart("simpleFields");
      for (String key : record.getSimpleFields().keySet())
      {
        g.writeRaw("\n    ");
        g.writeStringField(key, record.getSimpleField(key));
      }
      g.writeRaw("\n  ");
      g.writeEndObject(); // for simpleFields
View Full Code Here

      for (String key : record.getSimpleFields().keySet())
      {
        g.writeRaw("\n    ");
        g.writeStringField(key, record.getSimpleField(key));
      }
      g.writeRaw("\n  ");
      g.writeEndObject(); // for simpleFields

      // write listFields
      g.writeRaw("\n  ");
      g.writeObjectFieldStart("listFields");
View Full Code Here

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

      // write listFields
      g.writeRaw("\n  ");
      g.writeObjectFieldStart("listFields");
      for (String key : record.getListFields().keySet())
      {
        // g.writeStringField(key, record.getListField(key).toString());
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.