public static void writeObjectArrayAsJson(JsonGenerator generator, Object[] array,
      String pdxField) throws IOException {
    generator.writeStartArray();

    if (ArrayUtils.isNotEmpty(array)) {
      for (Object obj : array) {
        writeValueAsJson(generator, obj, pdxField);
      }
    }

    generator.writeEndArray();
  }
The JsonWriter class is an utility to write various java types as a JSON string.
<p>

@since GemFire 8.0
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JsonWriter.java