Package com.hp.hpl.jena.sparql.lib.org.json

Examples of com.hp.hpl.jena.sparql.lib.org.json.JSONArray


public class JSONExporterCls implements JSONExporter {

  public JSONArray convertLTToJSON(Collection<LearningTool> learningTools)
      throws JSONException {

    JSONArray curArray = new JSONArray();

    for (int i = 0; i < learningTools.size(); i++) {

      JSONObject obj = new JSONObject();

      LearningTool currentltools = ((List<LearningTool>) learningTools)
          .get(i);

      DescriptionNode node = new SimpleDescriptionNodeFactory()
          .createNode(currentltools);

      obj.put("title", node.getTitle());
      obj.put("description", node.getDescription());
      obj.put("toolURL", node.getToolURl());
      obj.put("cost", node.getToolCost());
      obj.put("availability", node.getToolAvailability());
      obj.put("openSource", node.isOpenSource());
      obj.put("launched", node.getLaunchedTime());
      obj.put("registration", node.registration());
      obj.put("hasFeature", node.getFeatures());
      obj.put("supportedMobileDevices", node.getsupportedMobileDevice());
      obj.put("supportedOS", node.getsupportedOS());

      curArray.put(obj);

    }
    return curArray;
  }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.lib.org.json.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.