Package org.jcoredb.service.http.output

Examples of org.jcoredb.service.http.output.JSONArray


   
    JSONAttribute path = new JSONAttribute("path", fs.getPath(), AttrType.String);
   
    root.add(path);
   
    JSONArray childs = new JSONArray("containers");
   
    for (int i = 0; i < cs.length; i++)
    {
       IContainer c = cs[i];
      
       JSONNode child = new JSONNode();
       JSONAttribute id = new JSONAttribute("id", ""+c.getId(), AttrType.Number);
       child.add(id);
      
       childs.add(child);
    }
   
    root.add(childs);
   
    out.println(root.toJSONString());
View Full Code Here


   
    node.add(new JSONAttribute("id", "0", AttrType.Number));
    node.add(new JSONAttribute("name", "root object", AttrType.String));

   
    JSONArray array = new JSONArray("childs");
   
    for (int i = 0; i < 10; i++) {

      JSONNode node1 = new JSONNode();
     
      node1.add(new JSONAttribute("id", "" + i, AttrType.Number));
      node1.add(new JSONAttribute("name","child node " + i, AttrType.String));
      node1.add(new JSONAttribute("created","01.01.1970", AttrType.Date));
      array.add(node1);
     
    }
       
    node.add(array);
   
View Full Code Here

     
      root.add(id);
      root.add(parentpath);
      root.add(numberofsegs);
     
      JSONArray segments = new JSONArray("segments");
     
      for (int i = 0; i < c.getSegments().length; i++)
      {
         ISegment s = c.getSegments()[i];

         JSONNode segementNode = new JSONNode();
         JSONAttribute segId = new JSONAttribute("id", ""+s.getId(), AttrType.Number);
         segementNode.add(segId);
        
         segments.add(segementNode);
     
     
      root.add(segments);
     
      out.println(root.toJSONString());
View Full Code Here

TOP

Related Classes of org.jcoredb.service.http.output.JSONArray

Copyright © 2018 www.massapicom. 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.