Package net.sf.json

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


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

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


    // Clear the root element and set the status
    this.rootObject.clear();
    this.rootObject.element("status", "error");
    JSONObject errElement = new JSONObject();

    errElement.element("type", ex.getType());
    errElement.element("message", ex.getMessage());
    if (isDebug) {
      // if in debug mode, add stack trace
      errElement.element("stacktrace", ex.getStringStackTrace());
    }
View Full Code Here

    this.rootObject.clear();
    this.rootObject.element("status", "error");
    JSONObject errElement = new JSONObject();

    errElement.element("type", ex.getType());
    errElement.element("message", ex.getMessage());
    if (isDebug) {
      // if in debug mode, add stack trace
      errElement.element("stacktrace", ex.getStringStackTrace());
    }
    this.rootObject.element("Error", errElement);
View Full Code Here

    errElement.element("type", ex.getType());
    errElement.element("message", ex.getMessage());
    if (isDebug) {
      // if in debug mode, add stack trace
      errElement.element("stacktrace", ex.getStringStackTrace());
    }
    this.rootObject.element("Error", errElement);

    // Write stream
    try {
View Full Code Here

  @SuppressWarnings("unchecked")
  private JSONObject processElement(CRResolvableBean crBean) {
    JSONObject objElement = new JSONObject();

    objElement.element("contentid", "" + crBean.getContentid());
    objElement.element("obj_id", "" + crBean.getObj_id());
    objElement.element("obj_type", "" + crBean.getObj_type());
    objElement.element("mother_id", ((crBean.getMother_id() == null) ? "" : "" + crBean.getMother_id()));
    objElement.element("mother_type", ((crBean.getMother_type() == null) ? "" : "" + crBean.getMother_type()));
View Full Code Here

  @SuppressWarnings("unchecked")
  private JSONObject processElement(CRResolvableBean crBean) {
    JSONObject objElement = new JSONObject();

    objElement.element("contentid", "" + crBean.getContentid());
    objElement.element("obj_id", "" + crBean.getObj_id());
    objElement.element("obj_type", "" + crBean.getObj_type());
    objElement.element("mother_id", ((crBean.getMother_id() == null) ? "" : "" + crBean.getMother_id()));
    objElement.element("mother_type", ((crBean.getMother_type() == null) ? "" : "" + crBean.getMother_type()));

    if (crBean.getAttrMap() != null && (!crBean.getAttrMap().isEmpty())) {
View Full Code Here

  private JSONObject processElement(CRResolvableBean crBean) {
    JSONObject objElement = new JSONObject();

    objElement.element("contentid", "" + crBean.getContentid());
    objElement.element("obj_id", "" + crBean.getObj_id());
    objElement.element("obj_type", "" + crBean.getObj_type());
    objElement.element("mother_id", ((crBean.getMother_id() == null) ? "" : "" + crBean.getMother_id()));
    objElement.element("mother_type", ((crBean.getMother_type() == null) ? "" : "" + crBean.getMother_type()));

    if (crBean.getAttrMap() != null && (!crBean.getAttrMap().isEmpty())) {
      JSONObject attrContainer = new JSONObject();
View Full Code Here

    JSONObject objElement = new JSONObject();

    objElement.element("contentid", "" + crBean.getContentid());
    objElement.element("obj_id", "" + crBean.getObj_id());
    objElement.element("obj_type", "" + crBean.getObj_type());
    objElement.element("mother_id", ((crBean.getMother_id() == null) ? "" : "" + crBean.getMother_id()));
    objElement.element("mother_type", ((crBean.getMother_type() == null) ? "" : "" + crBean.getMother_type()));

    if (crBean.getAttrMap() != null && (!crBean.getAttrMap().isEmpty())) {
      JSONObject attrContainer = new JSONObject();
View Full Code Here

    objElement.element("contentid", "" + crBean.getContentid());
    objElement.element("obj_id", "" + crBean.getObj_id());
    objElement.element("obj_type", "" + crBean.getObj_type());
    objElement.element("mother_id", ((crBean.getMother_id() == null) ? "" : "" + crBean.getMother_id()));
    objElement.element("mother_type", ((crBean.getMother_type() == null) ? "" : "" + crBean.getMother_type()));

    if (crBean.getAttrMap() != null && (!crBean.getAttrMap().isEmpty())) {
      JSONObject attrContainer = new JSONObject();

      Iterator<String> bit = crBean.getAttrMap().keySet().iterator();
View Full Code Here

                v = convertToString(obj);
                arr.add(v);
              }
            }
            value.addAll(arr);
            attrContainer.element(entry, value);
          } else if (bValue instanceof Map<?, ?>) {
            attrContainer.element(entry, bValue);
          }
          // dealt with single value attributes (String, Number,
          // ByteArray)
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.