Package net.sf.json

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


              }
            }
            value.addAll(arr);
            attrContainer.element(entry, value);
          } else if (bValue instanceof Map<?, ?>) {
            attrContainer.element(entry, bValue);
          }
          // dealt with single value attributes (String, Number,
          // ByteArray)
          else {
            String value = "";
View Full Code Here


          // dealt with single value attributes (String, Number,
          // ByteArray)
          else {
            String value = "";
            value = convertToString(bValue);
            attrContainer.element(entry, value);
          }
        }
      }
      objElement.element("attributes", attrContainer);
    }
View Full Code Here

                    String receivedLabel = UtilProperties.getMessage(resource, label, locale);
                    if (UtilValidate.isNotEmpty(receivedLabel)) {
                        resourceLabelList.add(receivedLabel);
                    }
                }
                jsonUiLabel.element(resource, resourceLabelList);
            }
        }

        writeJSONtoResponse(jsonUiLabel, response);
        return "success";
View Full Code Here

                    String receivedLabel = UtilProperties.getMessage(resource, label, locale);
                    if (UtilValidate.isNotEmpty(receivedLabel)) {
                        resourceLabelList.add(receivedLabel);
                    }
                }
                jsonUiLabel.element(resource, resourceLabelList);
            }
        }

        writeJSONtoResponse(jsonUiLabel, response);
        return "success";
View Full Code Here

        //********************************
       
        // Third generate a JSONObject object containts JSONArray
        JSONArray coursesListJSONArray = JSONArray.fromObject(coursesMapList);
        JSONObject respondJSONObject = new JSONObject();
        respondJSONObject.element("recommendedCoursesList", coursesListJSONArray);
       
        try {
            /* TODO output your page here. You may use following sample code. */
//            out.println("<!DOCTYPE html>");
//            out.println("<html>");
View Full Code Here

        //********************************
       
        // Third generate a JSONObject object containts JSONArray
        JSONArray coursesListJSONArray = JSONArray.fromObject(coursesMapList);
        JSONObject respondJSONObject = new JSONObject();
        respondJSONObject.element("searchedCoursesList", coursesListJSONArray);
       
        try {
            /* TODO output your page here. You may use following sample code. */
//            out.println("<!DOCTYPE html>");
//            out.println("<html>");
View Full Code Here

        //********************************
       
        // Forth generate a JSONObject object containts JSONArray
        JSONArray coursesListJSONArray = JSONArray.fromObject(coursesMapList);
        JSONObject respondJSONObject = new JSONObject();
        respondJSONObject.element("myCoursesList", coursesListJSONArray);
       
        try {
            /* TODO output your page here. You may use following sample code. */
//            out.println("<!DOCTYPE html>");
//            out.println("<html>");
View Full Code Here

        //********************************
       
        // Forth generate a JSONObject object containts JSONArray
        JSONArray commentsListJSONArray = JSONArray.fromObject(commentMapList);
        JSONObject respondJSONObject = new JSONObject();
        respondJSONObject.element("courseCommentsList", commentsListJSONArray);

        try {
            /* TODO output your page here. You may use following sample code. */
//            out.println("<!DOCTYPE html>");
//            out.println("<html>");
View Full Code Here

                    String receivedLabel = UtilProperties.getMessage(resource, label, locale);
                    if (UtilValidate.isNotEmpty(receivedLabel)) {
                        resourceLabelList.add(receivedLabel);
                    }
                }
                jsonUiLabel.element(resource, resourceLabelList);
            }
        }

        writeJSONtoResponse(jsonUiLabel, response);
        return "success";
View Full Code Here

            double quan = quantiles[qn];
            while (level >= quan && !timings.empty()) {
                timing = timings.pop();
                level -= 1.0 / rtimes.length;
            }
            result.element(String.valueOf(quan * 100), timing);
        }

        return result;
    }

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.