Example usage for com.google.gson JsonArray iterator

List of usage examples for com.google.gson JsonArray iterator

Introduction

In this page you can find the example usage for com.google.gson JsonArray iterator.

Prototype

public Iterator<JsonElement> iterator() 

Source Link

Document

Returns an iterator to navigate the elements of the array.

Usage

From source file:com.google.dart.server.generated.types.RemoveContentOverlay.java

License:Open Source License

public static List<RemoveContentOverlay> fromJsonArray(JsonArray jsonArray) {
    if (jsonArray == null) {
        return EMPTY_LIST;
    }/*from   w w w. j a v  a  2 s  . c o  m*/
    ArrayList<RemoveContentOverlay> list = new ArrayList<RemoveContentOverlay>(jsonArray.size());
    Iterator<JsonElement> iterator = jsonArray.iterator();
    while (iterator.hasNext()) {
        list.add(fromJson(iterator.next().getAsJsonObject()));
    }
    return list;
}

From source file:com.google.dart.server.generated.types.RenameFeedback.java

License:Open Source License

public static List<RenameFeedback> fromJsonArray(JsonArray jsonArray) {
    if (jsonArray == null) {
        return EMPTY_LIST;
    }/*from   www . jav a 2 s . c o m*/
    ArrayList<RenameFeedback> list = new ArrayList<RenameFeedback>(jsonArray.size());
    Iterator<JsonElement> iterator = jsonArray.iterator();
    while (iterator.hasNext()) {
        list.add(fromJson(iterator.next().getAsJsonObject()));
    }
    return list;
}

From source file:com.google.dart.server.generated.types.RenameOptions.java

License:Open Source License

public static List<RenameOptions> fromJsonArray(JsonArray jsonArray) {
    if (jsonArray == null) {
        return EMPTY_LIST;
    }/*from  www  .ja v a2s  .  com*/
    ArrayList<RenameOptions> list = new ArrayList<RenameOptions>(jsonArray.size());
    Iterator<JsonElement> iterator = jsonArray.iterator();
    while (iterator.hasNext()) {
        list.add(fromJson(iterator.next().getAsJsonObject()));
    }
    return list;
}

From source file:com.google.dart.server.generated.types.RequestError.java

License:Open Source License

public static List<RequestError> fromJsonArray(JsonArray jsonArray) {
    if (jsonArray == null) {
        return EMPTY_LIST;
    }/*from  ww w . ja v  a2 s.c  o  m*/
    ArrayList<RequestError> list = new ArrayList<RequestError>(jsonArray.size());
    Iterator<JsonElement> iterator = jsonArray.iterator();
    while (iterator.hasNext()) {
        list.add(fromJson(iterator.next().getAsJsonObject()));
    }
    return list;
}

From source file:com.google.dart.server.generated.types.SearchResult.java

License:Open Source License

public static List<SearchResult> fromJsonArray(JsonArray jsonArray) {
    if (jsonArray == null) {
        return EMPTY_LIST;
    }/*from   w w  w.  ja  v a2 s .c om*/
    ArrayList<SearchResult> list = new ArrayList<SearchResult>(jsonArray.size());
    Iterator<JsonElement> iterator = jsonArray.iterator();
    while (iterator.hasNext()) {
        list.add(fromJson(iterator.next().getAsJsonObject()));
    }
    return list;
}

From source file:com.google.dart.server.generated.types.SourceChange.java

License:Open Source License

public static List<SourceChange> fromJsonArray(JsonArray jsonArray) {
    if (jsonArray == null) {
        return EMPTY_LIST;
    }//from ww  w .j  a  v a  2 s  .c  om
    ArrayList<SourceChange> list = new ArrayList<SourceChange>(jsonArray.size());
    Iterator<JsonElement> iterator = jsonArray.iterator();
    while (iterator.hasNext()) {
        list.add(fromJson(iterator.next().getAsJsonObject()));
    }
    return list;
}

From source file:com.google.dart.server.generated.types.SourceEdit.java

License:Open Source License

public static List<SourceEdit> fromJsonArray(JsonArray jsonArray) {
    if (jsonArray == null) {
        return EMPTY_LIST;
    }//from w  ww. ja  v a 2s  .  c  o m
    ArrayList<SourceEdit> list = new ArrayList<SourceEdit>(jsonArray.size());
    Iterator<JsonElement> iterator = jsonArray.iterator();
    while (iterator.hasNext()) {
        list.add(fromJson(iterator.next().getAsJsonObject()));
    }
    return list;
}

From source file:com.google.dart.server.generated.types.SourceFileEdit.java

License:Open Source License

public static List<SourceFileEdit> fromJsonArray(JsonArray jsonArray) {
    if (jsonArray == null) {
        return EMPTY_LIST;
    }//from   w  ww . ja  v a 2 s  .c  o m
    ArrayList<SourceFileEdit> list = new ArrayList<SourceFileEdit>(jsonArray.size());
    Iterator<JsonElement> iterator = jsonArray.iterator();
    while (iterator.hasNext()) {
        list.add(fromJson(iterator.next().getAsJsonObject()));
    }
    return list;
}

From source file:com.google.dart.server.generated.types.TypeHierarchyItem.java

License:Open Source License

public static List<TypeHierarchyItem> fromJsonArray(JsonArray jsonArray) {
    if (jsonArray == null) {
        return EMPTY_LIST;
    }/*from w ww. ja va2  s  . co  m*/
    ArrayList<TypeHierarchyItem> list = new ArrayList<TypeHierarchyItem>(jsonArray.size());
    Iterator<JsonElement> iterator = jsonArray.iterator();
    while (iterator.hasNext()) {
        list.add(fromJson(iterator.next().getAsJsonObject()));
    }
    return list;
}

From source file:com.google.dart.server.internal.remote.processor.JsonProcessor.java

License:Open Source License

/**
 * Given some {@link JsonArray} and of {@code int} primitives, return the {@code int[]}.
 * //from  w w w .  j ava2 s.co m
 * @param intJsonArray some {@link JsonArray} of {@code int}s
 * @return the {@code int[]}
 */
protected int[] constructIntArray(JsonArray intJsonArray) {
    if (intJsonArray == null) {
        return new int[] {};
    }
    int i = 0;
    int[] ints = new int[intJsonArray.size()];
    Iterator<JsonElement> iterator = intJsonArray.iterator();
    while (iterator.hasNext()) {
        ints[i] = iterator.next().getAsInt();
        i++;
    }
    return ints;
}