Package org.opensocial.data

Examples of org.opensocial.data.OpenSocialObject


   *        or a subclass
   * @return
   */
  private static OpenSocialObject parseAsObject(JSONObject entryObject,
      Class<? extends OpenSocialObject> clientClass) {
    OpenSocialObject o = null;
    try {
      o = clientClass.newInstance();
    } catch (InstantiationException e) {
      throw new RuntimeException("Class not found " + clientClass);
    } catch (IllegalAccessException e) {
      throw new RuntimeException("Class not accessible " + clientClass);
    }

    Map<String, OpenSocialField> entryRepresentation =
        createObjectRepresentation(entryObject);

    for (Map.Entry<String,OpenSocialField> e : entryRepresentation.entrySet()) {
      o.setField(e.getKey(), e.getValue());
    }

    return o;
  }
View Full Code Here


      }

      if (isJsonObject(property)) {
        try {
          OpenSocialField field = new OpenSocialField(true);
          field.addValue(new OpenSocialObject(createObjectRepresentation(
              o.getJSONObject(key))));
          r.put(key, field);
          continue;
        } catch (JSONException e) {
          // If this isn't an object, try to parse it as something else
View Full Code Here

        continue;
      }

      if (isJsonObject(member)) {
        try {
          r.add(new OpenSocialObject(createObjectRepresentation(a.getJSONObject(i))));
          continue;
        } catch (JSONException e) {
          // If this isn't an object, try to parse it as something else
        }
      }
View Full Code Here

TOP

Related Classes of org.opensocial.data.OpenSocialObject

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.