Package org.json

Examples of org.json.JSONArray.optJSONObject()


        final Set<String> keySet = new HashSet<String>();

        // Checks whether the specified json object has all keys defined,
        // and whether the type of its value is appropriate
        for (int i = 0; i < keysDescription.length(); i++) {
            final JSONObject keyDescription = keysDescription.optJSONObject(i);

            final String key = keyDescription.optString("name");

            keySet.add(key);
View Full Code Here


            return null;
        }

        final JSONArray repositories = repositoriesDescription.optJSONArray("repositories");
        for (int i = 0; i < repositories.length(); i++) {
            final JSONObject repository = repositories.optJSONObject(i);
            if (repositoryName.equals(repository.optString("name"))) {
                return repository.optJSONArray("keys");
            }
        }
View Full Code Here

                                       + "] description, please define it in repositories.json");
        }

        final Set<String> ret = new HashSet<String>();
        for (int i = 0; i < keys.length(); i++) {
            final JSONObject keyDescription = keys.optJSONObject(i);
            final String key = keyDescription.optString("name");

            ret.add(key);
        }
View Full Code Here

   
    LogicFactory f = new LogicFactory();
    fLogics = new EntityQuery<Logic>();
    if (valid) {
      JSONArray logics = map.optJSONArray("logics");
      for (int i = 0; i < logics.length(); i++) fLogics.add(f.createFromJSON(logics.optJSONObject(i)));
    }
       
    fTiles = new byte[tilesets.length()][area];
    if (valid) {
      for (int j = 0; j < fTilesets.length; j++) {
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.