Package net.sf.json

Examples of net.sf.json.JSONObject.names()


        JSONArray array = (JSONArray) JSONSerializer.toJSON(json);
        int size = array.size();
       
        for(int i = 0; i < size; i++){
          JSONObject object = array.getJSONObject(i);
          String name = object.names().getString(0);
          JSONArray array_object = object.getJSONArray(name);
          int arraySize = array_object.size();
          Entity entity = new Entity(name);
         
        for(int j = 0; j < arraySize; j++){
View Full Code Here


                    if (details.has("wo_longest"))
                        facet.wo_longest = details.getInt("wo_longest");

                    if (details.has("hourly_totals")) {
                        final JSONObject hourlyTotals = details.getJSONObject("hourly_totals");
                        JSONArray names = hourlyTotals.names();
                        for (int i=0; i<names.size(); i++) {
                            String hour_of_day = names.getString(i);
                            long start = getTimeOfDay(hour_of_day, tzMap, defaultTimeZone);
                            JawboneUpMovesHourlyTotals totals = new JawboneUpMovesHourlyTotals();
                            totals.start = start;
View Full Code Here

                            }

                            try {
                                // If there's an attachment, we assume there's only one and that it's an image
                                final JSONObject imageAttachment = observation.getJSONObject("_attachments");
                                final String imageName = (String) imageAttachment.names().get(0);
                                facet.imageURL = rootURL + "/" + facet.mymeeId + "/" + imageName;
                            } catch (Throwable ignored) {
                                facet.imageURL = null;
                            }
View Full Code Here

            try {
                if (valueObject.has("_attachments")) {
                    // we assume that there's only one attachment and that it's an image
                    final JSONObject imageAttachment = valueObject.getJSONObject("_attachments");
                    final String imageName = (String) imageAttachment.names().get(0);
                    final String fetchURL = guestService.getApiKeyAttribute(updateInfo.apiKey, "fetchURL");
                    final String baseURL = getBaseURL(fetchURL);
                    final String mainDir = getMainDir(fetchURL);
                    if (baseURL!=null&&mainDir!=null) {
                        facet.imageURL = new StringBuilder(baseURL).append("/")
View Full Code Here

            List<? extends MetadataDefinition> definitions = PluginImpl.getInstance().getDefinitions();
            if (formData.has("definitions")) {
                JSONObject formDefinitions = formData.getJSONObject("definitions");
                if (!formDefinitions.isNullObject()) {
                    for (int i = 0; i < formDefinitions.size(); i++) {
                        String name = (String)formDefinitions.names().get(i);
                        Object definition = formDefinitions.get(name);
                        MetadataDefinition foundDefinition = TreeStructureUtil.getLeaf(definitions, name.split("_"));
                        if (foundDefinition != null) {
                            MetadataValue value = foundDefinition.createValue(definition);
                            presetValues.add(createAncestry(foundDefinition, value));
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.