public class Custom extends Object implements Exportable
| 构造器和说明 |
|---|
Custom() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
collaborativeField(String name)
Returns a reference that can be assigned to an object prototype field of a custom collaborative
object in order to define custom collaborative properties.
|
static String |
getId(Object obj)
Returns the id of the given custom object.
|
static Model |
getModel(Object obj)
Returns the model for the given custom object.
|
static boolean |
isCustomObject(Object obj)
Returns true if obj is a custom collaborative object, otherwise false.
|
static void |
registerType(Object type,
String name)
Registers a user-defined type as a collaborative type.
|
static void |
setInitializer(Object type,
ModelInitializerHandler initializer)
Sets the initializer function for the given type.
|
static void |
setOnLoaded(Object type,
DocumentLoadedHandler opt_onLoaded)
Sets the onLoaded function for the given type.
|
public static Object collaborativeField(String name)
name - The stable field name.public static String getId(Object obj)
obj - A custom object.public static Model getModel(Object obj)
obj - A custom object.public static boolean isCustomObject(Object obj)
obj - A custom object.public static void registerType(Object type, String name)
com.goodow.realtime.Realtime#load(String, DocumentLoadedHandler, ModelInitializerHandler, com.goodow.realtime.Error.ErrorHandler)type - The type to register.name - A name to use for this type.public static void setInitializer(Object type, ModelInitializerHandler initializer)
type - The type to register.initializer - An initializer function that will be called in the context of the
initialized object.public static void setOnLoaded(Object type, DocumentLoadedHandler opt_onLoaded)
type - The type to register.opt_onLoaded - An optional onLoaded function that will be called in the context of the
newly-loaded object. If not specified, a default onLoaded handler will be used.Copyright © 2013. All Rights Reserved.