Package org.json

Examples of org.json.JSONWriter.endArray()


        // List of primitive values.
        JSONWriter d = o.key("d").array();
        for (int di = 1; di < rand.nextInt(10) + 1; di++) {
          d.value("d" + di);
        }
        d.endArray();

        JSONWriter e = o.key("e").array();
        for (int ei = 1; ei < rand.nextInt(10) + 1; ei++) {
          if (rand.nextBoolean()) {
            e.value("e" + ei + "+" + i);
View Full Code Here


          } else {
            e.object().key("e.1").value("e.1_" + ei).key("e.2")
                .value("e.2_" + ei).endObject();
          }
        }
        e.endArray();

        o.endObject();
      }
      top.endArray();
    } catch (JSONException e) {
View Full Code Here

        // List of primitive values.
        JSONWriter d = o.key("d").array();
        for (int di = 1; di < rand.nextInt(10) + 1; di++) {
          d.value("d" + di);
        }
        d.endArray();

        JSONWriter e = o.key("e").array();
        for (int ei = 1; ei < rand.nextInt(10) + 1; ei++) {
          if (rand.nextBoolean()) {
            e.value("e" + ei + "+" + i);
View Full Code Here

          } else {
            e.object().key("e.1").value("e.1_" + ei).key("e.2")
                .value("e.2_" + ei).endObject();
          }
        }
        e.endArray();

        o.endObject();
      }
      top.endArray();
    } catch (JSONException e) {
View Full Code Here

            e.value("e" + ei + "+" + i);
          } else {
            e.object().key("e.1").value("e.1_" + ei).endObject();
          }
        }
        e.endArray();

        o.endObject();
      }
      top.endArray();
    } catch (JSONException e) {
View Full Code Here

        JSONWriter e = o.key("e").array();
        for (int ei = 1; ei <= 3; ei++) {
          e.object().key("e.1").value("e.1_" + ei).endObject();
        }
        e.endArray();

        o.endObject();
      }
      top.endArray();
    } catch (JSONException e) {
View Full Code Here

          //
          .endArray().endObject();

      topA.object().key("a").value("a_2").endObject();

      topA.endArray();

      JsonImport ji = new JsonImport(x.toString(),
          "Empty Nested Table 1", workspace, "UTF-8", -1);
      Worksheet w = ji.generateWorksheet();
      return w;
View Full Code Here

          //
          .endArray().endObject();

      topA.object().key("a").value("a_2").endObject();

      topA.endArray();

      JsonImport ji = new JsonImport(x.toString(),
          "Empty Nested Table 2", workspace, "UTF-8", -1);
      Worksheet w = ji.generateWorksheet();
      return w;
View Full Code Here

          //
          .endArray().endObject();

      topA.object().key("b").array().endArray().endObject();

      topA.endArray();

      JsonImport ji = new JsonImport(x.toString(),
          "Empty Nested Table 3", workspace, "UTF-8", -1);
      Worksheet w = ji.generateWorksheet();
      return w;
View Full Code Here

          //
          .endArray().endObject();

      topA.object().key("a").value("a_2").endObject();

      topA.endArray();

      JsonImport ji = new JsonImport(x.toString(),
          "Empty Nested Table 4", workspace, "UTF-8", -1);
      Worksheet w = ji.generateWorksheet();
      return w;
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.