Package com.google.appengine.repackaged.org.json

Examples of com.google.appengine.repackaged.org.json.JSONArray


  }

  private Work fetchWork(Config config) throws IOException, JSONException {
    JSONObject getwork = new JSONObject();
    getwork.put("method", "getwork");
    getwork.put("params", new JSONArray());
    getwork.put("id", 0);

    URL url = new URL(config.getJsonRpcServer());

    URLFetchService ufs = URLFetchServiceFactory.getURLFetchService();
View Full Code Here


     *
     * @param propertyName the property name
     * @return JsonArrayReader
     */
    public JsonArrayReader newArrayReader(String propertyName){
        JSONArray array = jsonObject.optJSONArray(propertyName);
        if(array == null) return null;
        return new JsonArrayReader(array, modelReader);
    }
View Full Code Here

     * @param modelReader the model reader
     */
    public JsonArrayReader(String json, ModelReader modelReader){
        super(modelReader);
        try{
            this.array = new JSONArray(json);
        } catch(JSONException e){
        }
    }
View Full Code Here

     *
     * @param propertyName the property name
     * @return JsonArrayReader
     */
    public JsonArrayReader newArrayReader(String propertyName){
        JSONArray array = jsonObject.optJSONArray(propertyName);
        if(array == null) return null;
        return new JsonArrayReader(array, 0, modelReader);
    }
View Full Code Here

   
    JSONObject album = findProfileAlbum(fb);
    if (album == null)
      return rawStringUtf8("No profile album found");
   
    final JSONArray photos = fb.query(album.getString("id") + "/photos").getJSONArray("data");
   
    attr(Values.PHOTO_ROWS, CollUtils.split(Funcs.map(Utils.range(photos.length()), new Func<Integer, PhotoWebView>() {
      @Override public PhotoWebView call(Integer photoIdx) {
        final JSONObject photo;
        try {
          photo = photos.getJSONObject(photoIdx);
        } catch (JSONException e) {
          throw new IllegalArgumentException(e);
        }
        return new PhotoWebView() {
          @Override public String getId() {
View Full Code Here

    }), 4));
    return null;
  }
 
  private JSONObject findProfileAlbum(Facebook fb) throws JSONException {
    JSONArray albums = fb.query("me/albums").getJSONArray("data");
    for (int i = 0; i < albums.length(); i++) {
      JSONObject album = albums.getJSONObject(i);
      String type = album.getString("type");
      if ("profile".equals(type))
        return album;
    }
    return null;
View Full Code Here

TOP

Related Classes of com.google.appengine.repackaged.org.json.JSONArray

Copyright © 2018 www.massapicom. 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.