Examples of opt()


Examples of com.addthis.maljson.JSONArray.opt()

            for (int i = 0; i < array.length(); i++) {
                Array.set(value, i, (byte) array.getInt(i));
            }
        } else {
            for (int i = 0; i < array.length(); i++) {
                Array.set(value, i, decodeObjectInternal(type, array.opt(i), array.getLineNumber(i), warnings));
            }
        }
        return value;
    }
View Full Code Here

Examples of com.alimama.mdrill.json.JSONObject.opt()

      JSONObject rowMap=list.getJSONObject(i);
      ArrayList<Object> row=new ArrayList<Object>();
      for(int j=0;j<this.parser.colsNames.length;j++)
      {
        String colname=this.parser.colsNames[j];
        row.add(j, String.valueOf(rowMap.opt(colname)));
      }
      results.add(row);
    }
    return total;
View Full Code Here

Examples of com.google.gwt.thirdparty.json.JSONObject.opt()

  }

  private void checkSplitPloints(File origSplitPoints, File fragmentsFile)
      throws Exception {
    JSONObject jsPoints = new JSONObject(stringContent(fragmentsFile));
    final JSONArray initSeq = (JSONArray) jsPoints.opt(EntityRecorder.INITIAL_SEQUENCE);
    if (initSeq != null) {
      // Considering stable order on "initial sequence". May be this is too strict, in that case,
      // we need to store the elements in a list and provide a search method
      JSONArray fragments = (JSONArray) jsPoints.get(EntityRecorder.FRAGMENTS);
      final Map<Integer, JSONObject> fragmentById = Maps.newHashMap();
View Full Code Here

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

            Map<String, String> parameters = new HashMap<String, String>();
            JSONObject json = JSONObject.fromString(paramsString);
            Iterator keys = json.keys();
            while (keys.hasNext()) {
                String key = keys.next().toString();
                parameters.put(key, json.opt(key).toString());
            }
            event.setParameters(parameters);
        }
       
        event.setElementName(request.getParameter(this.elementParameter));
View Full Code Here

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

    logMessage.setLocation(json.optString("location"));
    logMessage.setMessageBody(json.optString("messageBody"));
    logMessage.setTimestamp(json.optString("timestamp"));
    logMessage.setLogLevel(json.optInt("logLevel"));

    Object object = json.opt("messageObject");
    //System.out.println("message object type = " + json.opt("messageObject").getClass());
    //System.out.println("message object = " + json.opt("messageObject"));
    if (object instanceof JSONNull)
    {
      object = null;
View Full Code Here

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

      java.util.Map relMap = new java.util.HashMap();
      JSONObject jsonObj = (JSONObject)json;
      java.util.Iterator<String> keys = ((JSONObject)json).keys();
      while(keys.hasNext()){
        String key = keys.next();
        Object subJson = jsonObj.opt(key);

        Object valueObj = null;

        if(subJson instanceof JSONArray){
          valueObj = getObjWithSimpleType(java.util.List.class, subJson);
View Full Code Here

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

  @Override
  public void analyzeFile(FileConversionContext conversionContext) throws Exception {
    // No conversion required.
    JSONObject fileDescription = conversionContext.getAttachmentDescription();
    JSONObject originalObj = fileDescription.optJSONObject("original");
    fileDescription.put(UploadConstants.SIZE_KEY, originalObj.opt(UploadConstants.SIZE_KEY));
    fileDescription.put(UploadConstants.MIME_KEY, originalObj.opt(UploadConstants.MIME_KEY));
    fileDescription.put(UploadConstants.ENCODING_KEY, originalObj.opt(UploadConstants.ENCODING_KEY));
    fileDescription.put(UploadConstants.MEDIA_FILE_KEY, originalObj.opt(UploadConstants.MEDIA_FILE_KEY));
  }
View Full Code Here

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

  public void analyzeFile(FileConversionContext conversionContext) throws Exception {
    // No conversion required.
    JSONObject fileDescription = conversionContext.getAttachmentDescription();
    JSONObject originalObj = fileDescription.optJSONObject("original");
    fileDescription.put(UploadConstants.SIZE_KEY, originalObj.opt(UploadConstants.SIZE_KEY));
    fileDescription.put(UploadConstants.MIME_KEY, originalObj.opt(UploadConstants.MIME_KEY));
    fileDescription.put(UploadConstants.ENCODING_KEY, originalObj.opt(UploadConstants.ENCODING_KEY));
    fileDescription.put(UploadConstants.MEDIA_FILE_KEY, originalObj.opt(UploadConstants.MEDIA_FILE_KEY));
  }

  @Override
View Full Code Here

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

    // No conversion required.
    JSONObject fileDescription = conversionContext.getAttachmentDescription();
    JSONObject originalObj = fileDescription.optJSONObject("original");
    fileDescription.put(UploadConstants.SIZE_KEY, originalObj.opt(UploadConstants.SIZE_KEY));
    fileDescription.put(UploadConstants.MIME_KEY, originalObj.opt(UploadConstants.MIME_KEY));
    fileDescription.put(UploadConstants.ENCODING_KEY, originalObj.opt(UploadConstants.ENCODING_KEY));
    fileDescription.put(UploadConstants.MEDIA_FILE_KEY, originalObj.opt(UploadConstants.MEDIA_FILE_KEY));
  }

  @Override
  public void approveFile(FileConversionContext approvedContext) throws Exception {
View Full Code Here

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

    JSONObject fileDescription = conversionContext.getAttachmentDescription();
    JSONObject originalObj = fileDescription.optJSONObject("original");
    fileDescription.put(UploadConstants.SIZE_KEY, originalObj.opt(UploadConstants.SIZE_KEY));
    fileDescription.put(UploadConstants.MIME_KEY, originalObj.opt(UploadConstants.MIME_KEY));
    fileDescription.put(UploadConstants.ENCODING_KEY, originalObj.opt(UploadConstants.ENCODING_KEY));
    fileDescription.put(UploadConstants.MEDIA_FILE_KEY, originalObj.opt(UploadConstants.MEDIA_FILE_KEY));
  }

  @Override
  public void approveFile(FileConversionContext approvedContext) throws Exception {
   
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.