Examples of JsonAttribute


Examples of com.esri.gpt.framework.dcat.json.JsonAttribute

    String attrName = jsonReader.nextName();
    while (jsonReader.hasNext()) {
      JsonToken token = jsonReader.peek();
      switch (token) {
        case STRING:
          record.put(attrName, new JsonAttribute(jsonReader.nextString()));
          return;
        case NUMBER:
          record.put(attrName, new JsonAttribute(jsonReader.nextDouble()));
          return;
        case BOOLEAN:
          record.put(attrName, new JsonAttribute(jsonReader.nextBoolean()));
          return;
        case BEGIN_ARRAY:
          if ("distribution".equals(attrName)) {
            jsonReader.beginArray();
            parseDistributions(record.getDistribution());
View Full Code Here

Examples of com.esri.gpt.framework.dcat.json.JsonAttribute

      switch (token) {
        case END_ARRAY:
          jsonReader.endArray();
          break;
        case STRING:
          keywords.add(new JsonAttribute(jsonReader.nextString()));
          break;
        case NUMBER:
          keywords.add(new JsonAttribute(jsonReader.nextDouble()));
          break;
        case BOOLEAN:
          keywords.add(new JsonAttribute(jsonReader.nextBoolean()));
          break;
        default:
          throw new DcatParseException("Unexpected token in the data: " + token);
      }
    }
View Full Code Here

Examples of com.esri.gpt.framework.dcat.json.JsonAttribute

    String attrName = jsonReader.nextName();
    while (jsonReader.hasNext()) {
      JsonToken token = jsonReader.peek();
      switch (token) {
        case STRING:
          attributes.put(attrName, new JsonAttribute(jsonReader.nextString()));
          return;
        case NUMBER:
          attributes.put(attrName, new JsonAttribute(jsonReader.nextDouble()));
          return;
        case BOOLEAN:
          attributes.put(attrName, new JsonAttribute(jsonReader.nextBoolean()));
          return;
        default:
          throw new DcatParseException("Unexpected token in the data: " + token);
      }
    }
View Full Code Here

Examples of com.esri.gpt.framework.dcat.json.JsonAttribute

   * Gets attribute.
   * @param name attribute name
   * @return attribute value
   */
  protected String getString(String name) {
    JsonAttribute attr = attrs.get(name);
    return attr!=null? attr.getString(): "";
  }
View Full Code Here

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

    try
    {
      Block block = fs.read(blockId);
     
      JSONNode root = JSONHelper.createSuccessNode();
      JSONAttribute containerId = new JSONAttribute("containerId", ""+blockId.getContainerId(), AttrType.Number);
      JSONAttribute segmentId = new JSONAttribute("segmentId", ""+blockId.getSegmentId(), AttrType.Number);
      JSONAttribute id = new JSONAttribute("blockId", ""+blockId.getId(), AttrType.Number);
      JSONAttribute data = new JSONAttribute("data", Base64.encodeBase64String(block.getBytes()),AttrType.String);
      root.add(containerId);
      root.add(segmentId);
      root.add(id);
      root.add(data);
     
View Full Code Here

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

   
    IContainer[] cs = fs.getContainers();
       
    JSONNode root = new JSONNode();
   
    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);
    }
   
View Full Code Here

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

  public void test() {
   
    JSONNode node = new JSONNode();
    assertEquals("{}", node.toJSONString());
   
    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

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

   
    if (c!=null)
    {
   
      JSONNode root = JSONHelper.createSuccessNode();
      JSONAttribute id = new JSONAttribute("id", ""+c.getId(), AttrType.Number);
      JSONAttribute parentpath = new JSONAttribute("parentpath", c.getParentPath(), AttrType.String);
      JSONAttribute numberofsegs = new JSONAttribute("numberofsegs", ""+c.getNumOfSegs(), AttrType.Number);
     
      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);
     
     
View Full Code Here

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

    try
    {
      blockId = fs.append(block, only);
     
      JSONNode root = JSONHelper.createSuccessNode();
      JSONAttribute containerId = new JSONAttribute("containerId", ""+blockId.getContainerId(), AttrType.Number);
      JSONAttribute segmentId = new JSONAttribute("segmentId", ""+blockId.getSegmentId(), AttrType.Number);
      JSONAttribute id = new JSONAttribute("blockId", ""+blockId.getId(), AttrType.Number);
      root.add(containerId);
      root.add(segmentId);
      root.add(id);
     
      out.println(root.toJSONString());
View Full Code Here

Examples of org.myphotodiary.json.JsonAttribute

        getServletContext().log("No attribute.", ex);
      }

      // Create Json response
      List<JsonAttribute> attrs = new ArrayList<JsonAttribute>();
      JsonAttribute attrData;
      for (Attribute attribute: attributes) {
        attrData = new JsonAttribute();
        attrData.setTitle(attribute.getName());
        attrData.setKey(attribute.getName());
        attrs.add(attrData);
      }
      // Send JSON response
      response.setContentType(Configuration.jsonContentType);
      response.setCharacterEncoding(Configuration.contentEncoding);
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.