private T createPojo(JSONObject obj) throws IllegalAccessException, InstantiationException { Class<?> clazz = ParseRegistry.getParseClass(getClassName()); if (clazz != null) { T po = (T) clazz.newInstance(); /* We disable some checks while setting data in objects during fetch because those checks are useful only when setting data from client code. The "true" argument disables such checks. */ po.setData(obj, true); return po; } else { ParseObject po = new ParseObject(getClassName()); // see above for the "true" argument po.setData(obj, true); return (T) po; } }
public ParseObject(String className) { if (className == null) { LOGGER.error("You must specify a Parse class name when creating a new ParseObject."); throw new IllegalArgumentException( "You must specify a Parse class name when creating a new ParseObject."); } if ("_Parse4J".equals(className)) { className = ParseRegistry.getClassName(getClass()); } this.className = className; this.data = new Hashtable<String, Object>(); this.operations = new Hashtable<String, ParseFieldOperation>(); this.dirtyKeys = new ArrayList<String>(); setEndPoint("classes/" + className); }
@SuppressWarnings("unchecked") public static <T extends ParseObject> T create(Class<T> subclass) { return (T) create(ParseRegistry.getClassName(subclass)); }
public ParseQuery(Class<T> subclass) { this(ParseRegistry.getClassName(subclass)); }