/** * <p> * Constructs a new AVObject with no data in it. A AVObject constructed in this way will not have * an objectId and will not persist to the database until save() is called. * </p> * <p> * Class names must be alphanumerical plus underscore, and start with a letter. It is recommended * to name classes in CamelCaseLikeThis. * </p> * * @param theClassName The className for this AVObject. */ public AVObject(String theClassName) { this(); AVUtils.checkClassName(theClassName); className = theClassName; }
/** * <p> * Constructs a new AVObject with no data in it. A AVObject constructed in this way will not have * an objectId and will not persist to the database until save() is called. * </p> * <p> * Class names must be alphanumerical plus underscore, and start with a letter. It is recommended * to name classes in CamelCaseLikeThis. * </p> * * @param theClassName The className for this AVObject. */ public AVObject(String theClassName) { this(); AVUtils.checkClassName(theClassName); className = theClassName; }
AVQuery(String theClassName, Class<T> clazz) { AVUtils.checkClassName(theClassName); this.className = theClassName; this.clazz = clazz; this.conditions = new QueryConditions(); }
AVQuery(String theClassName, Class<T> clazz) { AVUtils.checkClassName(theClassName); this.className = theClassName; this.clazz = clazz; this.conditions = new QueryConditions(); }
/** * Register subclass to AVOSCloud SDK.It must be invocated before AVOSCloud.initialize. * * @param clazz The subclass. * @since 1.3.6 */ public static <T extends AVObject> void registerSubclass(Class<T> clazz) { AVClassName avClassName = clazz.getAnnotation(AVClassName.class); if (avClassName == null) { throw new IllegalArgumentException("The class is not annotated by @AVClassName"); } String className = avClassName.value(); AVUtils.checkClassName(className); SUB_CLASSES_MAP.put(className, clazz); SUB_CLASSES_REVERSE_MAP.put(clazz, className); ParserConfig.getGlobalInstance().putDeserializer(clazz, AVObjectDeserializer.instance); SerializeConfig.getGlobalInstance().put(clazz, AVObjectSerializer.instance); }
/** * Register subclass to AVOSCloud SDK.It must be invocated before AVOSCloud.initialize. * * @param clazz The subclass. * @param <T> AVObject subclass * @since 1.3.6 */ public static <T extends AVObject> void registerSubclass(Class<T> clazz) { AVClassName parseClassName = clazz.getAnnotation(AVClassName.class); if (parseClassName == null) { throw new IllegalArgumentException("The class is not annotated by @AVClassName"); } String className = parseClassName.value(); AVUtils.checkClassName(className); ParserConfig.getGlobalInstance().putDeserializer(clazz, AVObjectDeserializer.instance); SerializeConfig.getGlobalInstance().put(clazz, AVObjectSerializer.instance); SUB_CLASSES_MAP.put(className, clazz); SUB_CLASSES_REVERSE_MAP.put(clazz, className); }