Java Json toJsonArrayString(Iterator items)

Here you can find the source of toJsonArrayString(Iterator items)

Description

to Json Array String

License

Open Source License

Declaration

public static <T> JsonArray toJsonArrayString(Iterator<String> items) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Iterator;

import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonArrayBuilder;

public class Main {
    public static <T> JsonArray toJsonArrayString(Iterator<String> items) {
        JsonArrayBuilder builder = Json.createArrayBuilder();
        while (items.hasNext()) {
            builder.add(items.next());/*from ww  w. j  a  v a  2  s  . c om*/
        }
        return builder.build();
    }
}

Related

  1. printJavaxJsonProvider()
  2. read(String jsonString)
  3. readMandatoryDateField(JsonParser jsonParser, String fieldName)
  4. requiredParams(JsonObject map, String... params)
  5. toDouble(Object input)
  6. union(JsonObject... values)
  7. writeMandatoryDateField(JsonGenerator generator, String fieldName, Date value)
  8. writeReferenceValue(JsonGenerator generator, Integer value)