Package net.sf.json

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


      return null;
    }
    Profile p=new Profile();
    if(pp.getHadoopConf()!=null){
      JSONObject o=JSONObject.fromObject(pp.getHadoopConf());
      for(Object key:o.keySet()){
        p.getHadoopConf().put(key.toString(), o.getString(key.toString()));
      }
    }
    p.setId(pp.getId()==null?null:pp.getId().toString());
    p.setUid(pp.getUid());
View Full Code Here


   * @return List
   */
  public static List parseJson2List(String jsonString) {
    List list = new ArrayList();
    JSONObject jbJsonObject = JSONObject.fromObject(jsonString);
    Iterator iterator = jbJsonObject.keySet().iterator();
    while (iterator.hasNext()) {
      Dto dto = parseSingleJson2Dto(jbJsonObject.getString(iterator.next().toString()));
      list.add(dto);
    }
    return list;
View Full Code Here

        }
      }
    }
    else if (json instanceof JSONObject) {
      JSONObject jsonObject = (JSONObject) json;
      for (Object key : jsonObject.keySet()) {
        String strKey = (String) key;
        Object value = jsonObject.get(key);
        if (ERXRestUtils.isPrimitive(value)) {
          ERXRestRequestNode primitiveChild = new ERXRestRequestNode(strKey, value, false);
          requestNode.addChild(primitiveChild);
View Full Code Here

            }
            return returnedList;
        } else if (jsonRoot instanceof JSONObject) {
            Map<Object, Object> returnedMap = new HashMap<Object, Object>();
            JSONObject jsonObject = (JSONObject) jsonRoot;
            for (Object o : jsonObject.keySet()) {
                Object value = jsonObject.get(o);
                if (value instanceof JSON) {
                    returnedMap.put(o, convertToPlainJavaImplementation((JSON) value));
                } else {
                    returnedMap.put(o, value);
View Full Code Here

            for (int i = 0; i < array.size(); i++) {
                array.set(i, removeMutableWrapperFrom(array.get(i)));
            }
        } else if (jsonObject instanceof JSONObject) {
            JSONObject object = (JSONObject) jsonObject;
            for (Object key : object.keySet()) {
                object.put(key, removeMutableWrapperFrom(object.get(key)));
            }
        }
    }
View Full Code Here

          Object obj = ((JSONObject) object).get(key);
          if (obj instanceof JSONArray) {
            for (int i = 0; i < ((JSONArray) obj).size(); i++) {
              JSONObject child = (JSONObject) ((JSONArray) obj).get(i);
              writer.startNode((String) key);
              for (Object cKey : child.keySet()) {
                if (!((String) cKey).startsWith("@")) {
                  writer.startNode((String) cKey);
                  writeChild(writer, child.get(cKey));
                  writer.endNode();
                } else {
View Full Code Here

            // get everyone list
            returnedDataSets.add(everyoneMapper.execute(null));
        }
        else
        {
            for (Object objParam : jsonQuery.keySet())
            {

                DomainMapper<Object, List<?>> mapper = mappers.get(objParam);

                if (mapper != null)
View Full Code Here

            throw valEx;
        }

        JSONObject query = object.getJSONObject("query");

        for (Object key : query.keySet())
        {
            String keyStr = (String) key;

            try
            {
View Full Code Here

          final Object obj = ((JSONObject) object).get(key);
          if (obj instanceof JSONArray) {
            for (int i = 0; i < ((JSONArray) obj).size(); i++) {
              final JSONObject child = (JSONObject) ((JSONArray) obj).get(i);
              writer.startNode((String) key);
              for (Object cKey : child.keySet()) {
                if (!((String) cKey).startsWith("@")) {
                  writer.startNode((String) cKey);
                  writeChild(writer, child.get(cKey));
                  writer.endNode();
                } else {
View Full Code Here

    JXPathContext context = JXPathContext.newContext( def );

    JSONObject connection = (JSONObject) context.getValue( "definition/connection", JSONObject.class );
    if ( connection != null ) {
      @SuppressWarnings( "unchecked" )
      Set<String> keys = connection.keySet();
      props.addAll( keys );
    }

    JSONObject dataaccess = (JSONObject) context.getValue( "definition/dataaccess", JSONObject.class );
    if ( dataaccess != null ) {
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.