Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.JsonGenerator.writeObjectField()


                {
                    json.writeStringField("unit", timer.durationUnit().toString().toLowerCase());
                    writeSummarizable(timer, json);
                    writeSampling(timer, json);
                    if (context.showFullSamples) {
                        json.writeObjectField("values", timer.getSnapshot().getValues());
                    }
                }
                json.writeEndObject();

                json.writeFieldName("rate");
View Full Code Here


        public void processGauge(MetricName name, Gauge<?> gauge, Context context) throws Exception {
            final JsonGenerator json = context.json;
            json.writeStartObject();
            {
                json.writeStringField("type", "gauge");
                json.writeObjectField("value", evaluateGauge(gauge));
            }
            json.writeEndObject();
        }

        private static void writeSummarizable(Summarizable metric, JsonGenerator json) throws IOException {
View Full Code Here

                json.writeNumberField("count", histogram.count());
                writeSummarizable(histogram, json);
                writeSampling(histogram, json);

                if (context.showFullSamples) {
                    json.writeObjectField("values", histogram.getSnapshot().getValues());
                }
            }
            json.writeEndObject();
        }
View Full Code Here

                json.writeObjectFieldStart("_all");
                json.writeBooleanField("enabled", false);
                json.writeEndObject();
                json.writeObjectFieldStart("properties");
                json.writeObjectFieldStart("name");
                json.writeObjectField("type", "string");
                json.writeObjectField("index", "not_analyzed");
                json.writeEndObject();
                json.writeEndObject();
                json.writeEndObject();
View Full Code Here

                json.writeBooleanField("enabled", false);
                json.writeEndObject();
                json.writeObjectFieldStart("properties");
                json.writeObjectFieldStart("name");
                json.writeObjectField("type", "string");
                json.writeObjectField("index", "not_analyzed");
                json.writeEndObject();
                json.writeEndObject();
                json.writeEndObject();

                json.writeEndObject();
View Full Code Here

      final JsonGenerator json = JSON.getFactory().createGenerator(output);
     
      json.writeStartObject();
     
      // we only need to write a small amount of information
      json.writeObjectField("path", path);
      json.writeStringField("displayName", display_name);
     
      json.writeEndObject();
      json.close();
     
View Full Code Here

      final JsonGenerator json = JSON.getFactory().createGenerator(output);
     
      json.writeStartObject();
     
      // we only need to write a small amount of information
      json.writeObjectField("displayName", display_name);
      json.writeObjectField("tsuid", tsuid);
     
      json.writeEndObject();
      json.close();
     
View Full Code Here

     
      json.writeStartObject();
     
      // we only need to write a small amount of information
      json.writeObjectField("displayName", display_name);
      json.writeObjectField("tsuid", tsuid);
     
      json.writeEndObject();
      json.close();
     
      // TODO zero copy?
View Full Code Here

            jsonGenerator.writeStringField(ID, principal.getId());
            jsonGenerator.writeArrayFieldStart(ATTRIBUTES);
            final Map<String, Object> attributes = principal.getAttributes();
            for (final String key : attributes.keySet()) {
                jsonGenerator.writeStartObject();
                jsonGenerator.writeObjectField(key, attributes.get(key));
                jsonGenerator.writeEndObject();
            }
            jsonGenerator.writeEndArray();
            jsonGenerator.writeEndObject();
            return null;
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.