Examples of beginArray()


Examples of com.google.gson.stream.JsonWriter.beginArray()

      }

      // Write metadata for any entities
      if (!persistent.isEmpty()) {
        json.name("metadata");
        json.beginArray();
        for (HasUuid toWrite : persistent) {
          EntityMetadata meta = new EntityMetadata();
          meta.setPersistent(true);
          meta.setUuid(toWrite.getUuid());
          visitors.visit(this, meta);
View Full Code Here

Examples of com.google.gson.stream.JsonWriter.beginArray()

  }

  @Override
  public void writeNotNull(Object object, SerializationContext context) throws Exception {
    JsonWriter writer = context.getWriter();
    writer.beginArray();
    for (int i = 0, j = Array.getLength(object); i < j; i++) {
      context.pushPath("[" + i + "]");
      valueCodex.write(boxedType.cast(Array.get(object, i)), context);
      context.popPath();
    }
View Full Code Here

Examples of com.google.gson.stream.JsonWriter.beginArray()

  }

  @Override
  public void writeNotNull(T collection, SerializationContext context) throws IOException {
    JsonWriter writer = context.getWriter();
    writer.beginArray();
    int count = 0;
    for (V t : collection) {
      context.pushPath("[" + count++ + "]");
      valueCodex.write(t, context);
      context.popPath();
View Full Code Here

Examples of com.google.gson.stream.JsonWriter.beginArray()

  }

  @Override
  public void writeNotNull(T[] object, SerializationContext context) throws IOException {
    JsonWriter writer = context.getWriter();
    writer.beginArray();
    int count = 0;
    for (T t : object) {
      context.pushPath("[" + count++ + "]");
      valueCodex.write(t, context);
      context.popPath();
View Full Code Here

Examples of com.google.gson.stream.JsonWriter.beginArray()

  public static <T> void writeObjectsToStreamAsJson(Gson gson, OutputStream out, List<T> list)
      throws IOException {

    JsonWriter writer = new JsonWriter(new OutputStreamWriter(out, "UTF-8"));
    writer.setIndent("  ");
    writer.beginArray();
    for (T t : list) {
      gson.toJson(t, t.getClass(), writer);
    }
    writer.endArray();
    writer.close();
View Full Code Here

Examples of org.apache.olingo.odata2.core.ep.util.JsonStreamWriter.beginArray()

        jsonStreamWriter.beginObject()
            .namedStringValueRaw(FormatJson.COUNT, String.valueOf(inlineCount)).separator()
            .name(FormatJson.RESULTS);
      }

      jsonStreamWriter.beginArray();
      final String serviceRoot = properties.getServiceRoot().toASCIIString();
      boolean first = true;
      for (final Map<String, Object> entryData : data) {
        if (first) {
          first = false;
View Full Code Here

Examples of org.sonar.api.utils.text.JsonWriter.beginArray()

  }

  public String toJson() {
    StringWriter json = new StringWriter();
    JsonWriter writer = JsonWriter.of(json);
    writer.beginArray();
    for (QProfile profile : profiles) {
      writer
        .beginObject()
        .prop("key", profile.getKey())
        .prop("language", profile.getLanguage())
View Full Code Here

Examples of org.sonar.api.utils.text.JsonWriter.beginArray()

              mapper.selectProfileVersionDate(profileMeasure.getProfileId(), version), now);
          }
          // see format of JSON in org.sonar.batch.rule.UsedQProfiles
          StringWriter writer = new StringWriter();
          JsonWriter json = JsonWriter.of(writer);
          json
            .beginArray()
            .beginObject()
            .prop("key", profile.getKee())
            .prop("language", profile.getLanguage())
            .prop("name", profile.getName())
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.