Package com.fasterxml.jackson.core

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


            StringWriter searchParamStringWriter = new StringWriter();
            JsonGenerator gen = jsonFactory.createGenerator( searchParamStringWriter );
            gen.writeStartObject();
            gen.writeStringField( "jql", jqlQuery );
            gen.writeNumberField( "maxResults", nbEntriesMax );
            gen.writeArrayFieldStart( "fields" );
            // Retrieve all fields. If that seems slow, we can reconsider.
            gen.writeString( "*all" );
            gen.writeEndArray();
            gen.writeEndObject();
            gen.close();
View Full Code Here


            StringWriter searchParamStringWriter = new StringWriter();
            JsonGenerator gen = jsonFactory.createGenerator( searchParamStringWriter );
            gen.writeStartObject();
            gen.writeStringField( "jql", jqlQuery );
            gen.writeNumberField( "maxResults", nbEntriesMax );
            gen.writeArrayFieldStart( "fields" );
            // Retrieve all fields. If that seems slow, we can reconsider.
            gen.writeString( "*all" );
            gen.writeEndArray();
            gen.writeEndObject();
            gen.close();
View Full Code Here

         
          if (!data_query.getNoAnnotations()) {
            final List<Annotation> annotations = dps.getAnnotations();
            if (annotations != null) {
              Collections.sort(annotations);
              json.writeArrayFieldStart("annotations");
              for (Annotation note : annotations) {
                json.writeObject(note);
              }
              json.writeEndArray();
            }
View Full Code Here

              json.writeEndArray();
            }
           
            if (globals != null && !globals.isEmpty()) {
              Collections.sort(globals);
              json.writeArrayFieldStart("globalAnnotations");
              for (Annotation note : globals) {
                json.writeObject(note);
              }
              json.writeEndArray();
            }
View Full Code Here

  public void serialize(@Nonnull Iterable<QueryResult> results, @Nonnull OutputStream out) throws IOException {
    JsonGenerator g = jsonFactory.createGenerator(out, JsonEncoding.UTF8);
    g.writeStartObject();
    g.writeNumberField("timestamp", System.currentTimeMillis() / 1000);
    g.writeNumberField("proto_version", STACKDRIVER_PROTOCOL_VERSION);
    g.writeArrayFieldStart("data");

    for (QueryResult metric : results) {
      g.writeStartObject();
      g.writeStringField("name", metric.getName());
      if (instanceId != null && !instanceId.isEmpty()) {
View Full Code Here

    }

    public void serialize(@Nonnull Iterable<QueryResult> counters, @Nonnull Iterable<QueryResult> gauges, @Nonnull OutputStream out) throws IOException {
        JsonGenerator g = jsonFactory.createGenerator(out, JsonEncoding.UTF8);
        g.writeStartObject();
        g.writeArrayFieldStart("counters");

        for (QueryResult counter : counters) {
            g.writeStartObject();
            g.writeStringField("name", counter.getName());
            if (source != null && !source.isEmpty()) {
View Full Code Here

            }
            g.writeEndObject();
        }
        g.writeEndArray();

        g.writeArrayFieldStart("gauges");

        for (QueryResult gauge : gauges) {
            g.writeStartObject();
            g.writeStringField("name", gauge.getName());
            if (source != null && !source.isEmpty()) {
View Full Code Here

        jg.writeStartObject();

        jg.writeStringField(GraphSONTokens.MODE, mode.toString());

        jg.writeArrayFieldStart(GraphSONTokens.VERTICES);

        final Iterable<Vertex> vertices = vertices(normalize);
        for (Vertex v : vertices) {
            jg.writeTree(graphson.objectNodeFromElement(v));
        }
View Full Code Here

            jg.writeTree(graphson.objectNodeFromElement(v));
        }

        jg.writeEndArray();

        jg.writeArrayFieldStart(GraphSONTokens.EDGES);

        final Iterable<Edge> edges = edges(normalize);
        for (Edge e : edges) {
            jg.writeTree(graphson.objectNodeFromElement(e));
        }
View Full Code Here

        jgen.writeStringField("type", "FeatureCollection");

        writeJsonProperties(jgen);
       
        jgen.writeArrayFieldStart("features");
        {
          for (int f = 0; f < capacity; f++) {
            writeFeature(f, jgen, forcePoints);
          }
        }
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.