Examples of JSONArray


Examples of org.primefaces.json.JSONArray

  @Override
  public Trip loadGoogleData(Trip trip, JSONObject json) throws IOException,
      JSONException {
    List<Point> points = new ArrayList<Point>();
    if ("OK".equals(json.getString("status"))) {
      JSONArray routes = json.getJSONArray("routes");
      // routes contains// routes contains possible routes; use the
      // first one?
      if (routes.length() > 0) {
        // a route contains legs from start to endpoint
        JSONObject route = routes.getJSONObject(0);

        JSONArray legs = route.getJSONArray("legs");
        int order = 1;
        for (int l = 0; l < legs.length(); l++) {
          // a leg contains steps between waypoints
          JSONObject leg = legs.getJSONObject(l);
          JSONArray steps = leg.getJSONArray("steps");

          if (steps.length() < 0)
            continue;

          for (int s = 0; s < steps.length(); s++) {
            JSONObject step = steps.getJSONObject(s);
            JSONObject poly = step.getJSONObject("polyline");
            if (!points.isEmpty())
              order = points.get(points.size() - 1).getOrder();

            List<Point> polyline = decode(poly.getString("points"),
View Full Code Here

Examples of org.richfaces.json.JSONArray

    public Object getAsObject(FacesContext context, UIComponent component, String value) {
        try {
            if (value.charAt(0) == '{') {
                return new JSONObject(value);
            }
            return new JSONArray(value);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }
View Full Code Here

Examples of org.slim3.repackaged.org.json.JSONArray

     *
     * @param propertyName the property name
     * @return JsonArrayReader
     */
    public JsonArrayReader newArrayReader(String propertyName){
        JSONArray array = jsonObject.optJSONArray(propertyName);
        if(array == null) return null;
        return new JsonArrayReader(array, modelReader);
    }
View Full Code Here

Examples of org.sourceforge.jsonedit.core.outline.elements.JsonArray

   * @throws BadLocationException
   * @throws BadPositionCategoryException
   */
  private void doJsonArray(String key, int startPos) throws JsonReaderException, JsonTextOutlineParserException, BadLocationException, BadPositionCategoryException {
   
    JsonArray jsonArray = new JsonArray(parent, key);
    if (root == null) {
      root = jsonArray;
      parent = root;
    } else {
      parent.addChild(jsonArray);
      parent = jsonArray;
    }
   
    jsonArray.setPosition(startPos, parser.getPosition() - startPos + 1, doc);
   
    char ch;
    do {
      ch = parser.getNextClean();
      int start = parser.getPosition();
View Full Code Here

Examples of org.unidal.webres.json.JsonArray

    return builder.toString();
  }

  public String parseDomain(String content) throws Exception {
    JsonObject object = new JsonObject(content);
    JsonArray projectArray = object.getJSONArray("projects");

    if (projectArray.length() > 0) {
      JsonObject firstProject = projectArray.getJSONObject(0);
      return firstProject.get("project_name").toString();
    }
    return null;
  }
View Full Code Here

Examples of org.vertx.java.core.json.JsonArray

    private final JsonArray worlds;

    public MongoHandler(HttpServerRequest request, int queriesParam) {
      req = request;
      queries = queriesParam;
      worlds = new JsonArray();
    }
View Full Code Here

Examples of org.zkoss.json.JSONArray

  protected abstract List<Drawable> getDrawables();
 
  @SuppressWarnings("unchecked")
  @Override
  public JSONAware getShapeJSONObject() {
    JSONArray result = new JSONArray();
    for(Drawable d : getDrawables())
      result.add(d);
    return result;
  }
View Full Code Here

Examples of restx.build.org.json.JSONArray

            }

            Map<String, List<ModuleDependency>> dependencies = new LinkedHashMap<>();

            if (jsonObject.has("dependencies")) {
                JSONArray deps = jsonObject.getJSONObject("dependencies").getJSONArray("dependency");

                for (int i = 0; i < deps.length(); i++) {
                    JSONObject dep = deps.getJSONObject(i);
                    String scope = dep.has("scope") ? dep.getString("scope") : "compile";

                    List<ModuleDependency> scopeDependencies = dependencies.get(scope);
                    if (scopeDependencies == null) {
                        dependencies.put(scope, scopeDependencies = new ArrayList<>());
View Full Code Here

Examples of se.llbit.json.JsonArray

      String versionName = obj.get("name").stringValue("");
      if (!versionName.equals(version)) {
        System.err.println("Stored version name does not match file name");
        return false;
      }
      JsonArray array = obj.get("libraries").array();
      for (JsonValue value: array.getElementList()) {
        VersionInfo.Library lib = new VersionInfo.Library(value.object());
        switch (lib.testIntegrity(libDir)) {
        case INCOMPLETE_INFO:
          System.err.println("Missing library name or checksum");
          return false;
View Full Code Here

Examples of se.sics.json.JSONArray

    public boolean isConnected() {
        return !isConnected;
    }

    String[] getNodes(JSONObject json) {
        JSONArray nodes;
        String node;
        String[] nString = null;
        if ((nodes = json.getJSONArray("node")) != null) {
            nString = new String[nodes.size()];
            for(int i = 0, n = nodes.size(); i < n; i++) {
                node = nodes.getAsString(i);
                nString[i] = node;
            }
        } else if ((node = json.getAsString("node")) != null) {
            nString = new String[1];
            nString[0] = node;
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.