Package org.opensocial.models

Examples of org.opensocial.models.Model


          }
          if (dataObject.containsKey("list")) {
            Object list = dataObject.get("list");
            if (list.getClass().equals(JSONArray.class)) {
              for (int i = 0; i < ((List) list).size(); i++) {
                Model object = (Model) ((List) list).get(i);
                response.getEntries().add(cloneModelObject(object,
                    modelClass));
              }
            } else if (list.getClass().equals(JSONObject.class)) {
              response.getEntries().add(cloneModelObject((Model) list,
View Full Code Here


      public Map createObjectContainer() {
        try {
          return modelClass.newInstance();
        } catch (InstantiationException e) {
          return new Model();
        } catch (IllegalAccessException e) {
          return new Model();
        }
      }
    };

    return containerFactory;
View Full Code Here

    return containerFactory;
  }

  private static Model cloneModelObject(Model model,
      final Class<? extends Model> modelClass) {
    Model clone = null;
    try {
      clone = modelClass.newInstance();
    } catch (InstantiationException e) {
      return model;
    } catch (IllegalAccessException e) {
      return model;
    }

    for (Map.Entry entry : (Set<Map.Entry>) model.entrySet()) {
      clone.put(entry.getKey(), entry.getValue());
    }

    return clone;
  }
View Full Code Here

TOP

Related Classes of org.opensocial.models.Model

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.