Package net.sf.json

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


//          }
//        }
        CapBeanUtil.map2Bean(jsData, ctDtl);
        ctDtl.setDivCtNo(ctItm.getDivCtNo());
        ctDtl.setDivCtSor(new BigDecimal(i+1));
        ctDtl.setRangeNo(jsData.optString("rangeNo"));
        DivFtDtl ftDtl = factorMntService.findByFactorNoAndRangeNo(
            jsData.optString("factorNo"), jsData.optString("rangeNo"));
        ctDtl.setDivFtDtl(ftDtl);
        ctDtl.setDivCtItm(ctItm);
//        if(haveOld){
View Full Code Here


        CapBeanUtil.map2Bean(jsData, ctDtl);
        ctDtl.setDivCtNo(ctItm.getDivCtNo());
        ctDtl.setDivCtSor(new BigDecimal(i+1));
        ctDtl.setRangeNo(jsData.optString("rangeNo"));
        DivFtDtl ftDtl = factorMntService.findByFactorNoAndRangeNo(
            jsData.optString("factorNo"), jsData.optString("rangeNo"));
        ctDtl.setDivFtDtl(ftDtl);
        ctDtl.setDivCtItm(ctItm);
//        if(haveOld){
//          ctDtls.set(j, ctDtl);
//        }else{
View Full Code Here

        CapBeanUtil.map2Bean(jsData, ctDtl);
        ctDtl.setDivCtNo(ctItm.getDivCtNo());
        ctDtl.setDivCtSor(new BigDecimal(i+1));
        ctDtl.setRangeNo(jsData.optString("rangeNo"));
        DivFtDtl ftDtl = factorMntService.findByFactorNoAndRangeNo(
            jsData.optString("factorNo"), jsData.optString("rangeNo"));
        ctDtl.setDivFtDtl(ftDtl);
        ctDtl.setDivCtItm(ctItm);
//        if(haveOld){
//          ctDtls.set(j, ctDtl);
//        }else{
View Full Code Here

//          }
//        }
        CapBeanUtil.map2Bean(jsData, rlDtl);
        rlDtl.setDivRlNo(rlItm.getDivRlNo());
        rlDtl.setDivRlSor(new BigDecimal(i+1));
        rlDtl.setDivCtNo(jsData.optString("divCtNo"));
        DivCtItm ctItm = conditionMntService.getById(jsData.optString("divCtOid"));
//        rlDtl.setDivCtItm(ctItm);
        rlDtl.setDivRlItm(rlItm);
//        if(haveOld){
//          rlDtls.set(j, rlDtl);
View Full Code Here

//        }
        CapBeanUtil.map2Bean(jsData, rlDtl);
        rlDtl.setDivRlNo(rlItm.getDivRlNo());
        rlDtl.setDivRlSor(new BigDecimal(i+1));
        rlDtl.setDivCtNo(jsData.optString("divCtNo"));
        DivCtItm ctItm = conditionMntService.getById(jsData.optString("divCtOid"));
//        rlDtl.setDivCtItm(ctItm);
        rlDtl.setDivRlItm(rlItm);
//        if(haveOld){
//          rlDtls.set(j, rlDtl);
//        }else{
View Full Code Here

    }

    @Override
    public String toString() {
        JSONObject _json = JSONObject.fromObject(json);
        String cause = _json.optString("cause");
        if (cause.isEmpty()) {
            return super.toString() + "\n" + _json.toString(2);
        } else {
            _json.put("cause", "…");
            return super.toString() + "\n" + _json.toString(2) + "\nCaused on server by: " + cause + "[end of server exception]";
View Full Code Here

      // This is uploading to an existing document
      JSONObject doc = null;
      try {
        doc = couchDb.getDocument(docId);
       
        logger.info("onLoad fetched: "+doc.optString("_id")+" -> "+doc.optString("_rev"));
      } catch(Exception e) {
        logger.error("Unable to load document for id: "+docId,e);
      }

      if( null != doc ) {
View Full Code Here

      // This is uploading to an existing document
      JSONObject doc = null;
      try {
        doc = couchDb.getDocument(docId);
       
        logger.info("onLoad fetched: "+doc.optString("_id")+" -> "+doc.optString("_rev"));
      } catch(Exception e) {
        logger.error("Unable to load document for id: "+docId,e);
      }

      if( null != doc ) {
View Full Code Here

   
    JSONArray replications = doc.optJSONArray("replications");
    if( null != replications ) {
      for(int i=0, e=replications.size(); i<e; ++i) {
        JSONObject replicationJson = replications.getJSONObject(i);
        String direction = replicationJson.optString("direction");
       
        // Outgoing
        if( REPLICATION_DIRECTION_OUTGOING.equals(direction)
         || REPLICATION_DIRECTION_BIDIRECTIONAL.equals(direction) ) {
          ReplicationRequest replicationRequest = new ReplicationRequest();
View Full Code Here

          replicationRequest.setTargetServerUrl( replicationJson.getString("remoteServerUrl") );
         
          replicationRequest.setTargetUserName( ReplicationRequest.REMOTE_USER_NAME );
          replicationRequest.setTargetPassword( ReplicationRequest.REMOTE_USER_PASSWORD );
         
          String filterName = replicationJson.optString("filterName", null);
          if( null != filterName ) {
            replicationRequest.setFilter( filterName );
          }
         
          boolean continuous = replicationJson.optBoolean("continuous",false);
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.