ObjectsUtils contains utility methods for working with objects.
Author: Christophe Herreman
Version: $Revision: 21 $, $Date: 2008-11-01 22:58:42 +0100 (za, 01 nov 2008) $, $Author: dmurat $
Since: 0.1
public static function clone(object:Object):*Parameters
Returns
public static function getFullQualifiedClassName(object:Object):StringParameters
Returns
public static function getKeys(object:Object):Array
Returns an array with the keys of this object.
Parameters
Returns
public static function getNumProperties(object:Object):int
Returns the number of properties in this object.
Parameters
Returns
public static function isExplicitInstanceOf(object:Object, clazz:Class):Boolean
Checks if the given object is an explicit instance of the given class.
That means that true will only be returned if the object
was instantiated directly from the given class.
Parameters
| object:Object — the object to check
|
| |
| clazz:Class — the class from which the object should be an explicit instance
|
Returns
| Boolean — true if the object is an explicit instance of the class, false if not
|
public static function toInstance(object:Object, clazz:Class):*
Converts a plain vanilla object to be an instance of the class
passed as the second variable. This is not a recursive funtion
and will only work for the first level of nesting. When you have
deeply nested objects, you first need to convert the nested
objects to class instances, and then convert the top level object.
TODO: This method can be improved by making it recursive. This would be
done by looking at the typeInfo returned from describeType and determining
which properties represent custom classes. Those classes would then
be registerClassAlias'd using getDefinititonByName to get a reference,
and then objectToInstance would be called on those properties to complete
the recursive algorithm.
Parameters
| object:Object — The plain object that should be converted
|
| |
| clazz:Class — The type to convert the object to
|
Returns
Spring ActionScript 0.7 - 2009