Package org.json

Examples of org.json.JSONObject.sortedKeys()


        JSONArray fileArray = r.document.getJSONArray("DATA");
        for (int i = 0; i < fileArray.length(); i++) {
            JSONObject fileObject = fileArray.getJSONObject(i);
            System.out.println("  " + fileObject.getString("name"));
            Iterator keysIter = fileObject.sortedKeys();
            while (keysIter.hasNext()) {
                String key = (String) keysIter.next();
                if (!key.equals("DATA_TYPE") && !key.equals("LINKS") && !key.endsWith("_link") && !key.equals("name")) {
                    System.out.println("    " + key + ": " + fileObject.getString(key));
                }
View Full Code Here


              }
             
              //for each prop
              if(feature instanceof SbiFeature) {
                JSONObject properties = ((SbiFeature)feature).getProperties();
                Iterator keysIterator = properties.sortedKeys();
                while(keysIterator.hasNext()) {
                  String key = (String)keysIterator.next();
                  jsonProperties.accumulate(key, properties.get(key));
                }
              }
View Full Code Here

        writer.addNewLine();
        writer.addLine("public interface " + fileName + " {");
        writer.indentBlock();

        final JSONObject dico = new JSONObject(tokener);
        final Iterator<String> domainKeys = dico.sortedKeys();
        while (domainKeys.hasNext()) {
            // Domain
            final String domainKey = domainKeys.next();
            writer.addLine("public interface " + domainKey.toUpperCase() + " {");
            writer.indentBlock();
View Full Code Here

            final String domainKey = domainKeys.next();
            writer.addLine("public interface " + domainKey.toUpperCase() + " {");
            writer.indentBlock();

            final JSONObject domain = dico.getJSONObject(domainKey);
            final Iterator<String> keys = domain.sortedKeys();
            while (keys.hasNext()) {
                final String key = keys.next();
                final String keyUpper = GeneratorHelper.toUpperUnderscore(key);
                final JSONArray values = domain.getJSONArray(key);
                if (verbose) writer.addLine("public static final String " + keyUpper + " = \"" + key + "\";");
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.