Package org.codehaus.jackson

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


        {
            generator.writeArrayFieldStart(name);
            generator.writeString(value);
        }
        else
            generator.writeStringField(name, value);
       
        lastNumber = fieldNumber;
        lastRepeated = repeated;
    }
View Full Code Here


  @Override
  public void format(OutputStream o, Event e) throws IOException {
    JsonGenerator g = jsonFactory.createJsonGenerator(o, JsonEncoding.UTF8);
    g.writeStartObject();
    g.writeStringField("body", new String(e.getBody()));
    g.writeNumberField("timestamp", e.getTimestamp());
    g.writeStringField("pri", e.getPriority().toString());
    g.writeNumberField("nanos", e.getNanos());
    g.writeStringField("host", e.getHost());
    g.writeObjectFieldStart("fields");
View Full Code Here

  public void format(OutputStream o, Event e) throws IOException {
    JsonGenerator g = jsonFactory.createJsonGenerator(o, JsonEncoding.UTF8);
    g.writeStartObject();
    g.writeStringField("body", new String(e.getBody()));
    g.writeNumberField("timestamp", e.getTimestamp());
    g.writeStringField("pri", e.getPriority().toString());
    g.writeNumberField("nanos", e.getNanos());
    g.writeStringField("host", e.getHost());
    g.writeObjectFieldStart("fields");
    for (Entry<String, byte[]> a : e.getAttrs().entrySet()) {
      g.writeStringField(a.getKey(), new String(a.getValue()));
View Full Code Here

    g.writeStartObject();
    g.writeStringField("body", new String(e.getBody()));
    g.writeNumberField("timestamp", e.getTimestamp());
    g.writeStringField("pri", e.getPriority().toString());
    g.writeNumberField("nanos", e.getNanos());
    g.writeStringField("host", e.getHost());
    g.writeObjectFieldStart("fields");
    for (Entry<String, byte[]> a : e.getAttrs().entrySet()) {
      g.writeStringField(a.getKey(), new String(a.getValue()));
    }
    g.writeEndObject();
View Full Code Here

    g.writeStringField("pri", e.getPriority().toString());
    g.writeNumberField("nanos", e.getNanos());
    g.writeStringField("host", e.getHost());
    g.writeObjectFieldStart("fields");
    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();
View Full Code Here

    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
        dumpGenerator.writeStringField("key", (String) item.getKey());
        dumpGenerator.writeStringField("value",
                                       config.get((String) item.getKey()));
        dumpGenerator.writeBooleanField("isFinal",
                                        config.finalParameters.contains(item.getKey()));
        dumpGenerator.writeStringField("resource",
View Full Code Here

    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
        dumpGenerator.writeStringField("key", (String) item.getKey());
        dumpGenerator.writeStringField("value",
                                       config.get((String) item.getKey()));
        dumpGenerator.writeBooleanField("isFinal",
                                        config.finalParameters.contains(item.getKey()));
        dumpGenerator.writeStringField("resource",
                                       config.updatingResource.get(item.getKey()));
View Full Code Here

        dumpGenerator.writeStringField("key", (String) item.getKey());
        dumpGenerator.writeStringField("value",
                                       config.get((String) item.getKey()));
        dumpGenerator.writeBooleanField("isFinal",
                                        config.finalParameters.contains(item.getKey()));
        dumpGenerator.writeStringField("resource",
                                       config.updatingResource.get(item.getKey()));
        dumpGenerator.writeEndObject();
      }
    }
    dumpGenerator.writeEndArray();
View Full Code Here

        String[] resources = config.updatingResource.get(item.getKey());
        String resource = UNKNOWN_RESOURCE;
        if(resources != null && resources.length > 0) {
          resource = resources[0];
        }
        dumpGenerator.writeStringField("resource", resource);
        dumpGenerator.writeEndObject();
      }
    }
    dumpGenerator.writeEndArray();
    dumpGenerator.writeEndObject();
View Full Code Here

    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
        dumpGenerator.writeStringField("key", (String) item.getKey());
        dumpGenerator.writeStringField("value",
                                       config.get((String) item.getKey()));
        dumpGenerator.writeBooleanField("isFinal",
                                        config.finalParameters.contains(item.getKey()));
        String[] resources = config.updatingResource.get(item.getKey());
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.