Packageorg.servebox.commons.map
Classpublic class MapUtils

MapUtils is a helper class with a lot of static methods to manipulate classes that implements IMap interface.



Public Methods
 MethodDefined by
  
[static] Copies the properties of the object inside the DictionaryTable.
MapUtils
  
[static] Creates an object and fill it by mapping the DictionaryTable key/value pairs to the object accessors.
MapUtils
  
[static] Unserializes an object from a DictionaryTable using keyRoot as the root property path.
MapUtils
  
recursiveAccessorsPut(dt:DictionaryTable, obj:IBasicObject, keyRoot:String = "", keepObjects:Boolean = false):void
[static] Serializes an object to a DictionaryTable using keyRoot as the root property path.
MapUtils
  
registerSubTypeMapping(type:String, clazz:Class, ignoreRecursion:Boolean = false):void
[static] Registers a type mapping used to instantiate sub-objects while using getObjectFromDictionaryTable method.
MapUtils
Public Constants
 ConstantDefined by
  PROPERTY_SEPARATOR : String = "$"
[static] The separator used to when flattening an IBasicObject.
MapUtils
Method detail
getDictionaryTableFromObjectAccessors()method
public static function getDictionaryTableFromObjectAccessors(dt:DictionaryTable, obj:IBasicObject, keepObjects:Boolean = false):DictionaryTable

Copies the properties of the object inside the DictionaryTable. IBasicObject instances will be recursively flattened. if keepObjects = true IBasicObject will also be stored not flattened.

Parameters
dt:DictionaryTable
 
obj:IBasicObject
 
keepObjects:Boolean (default = false)

Returns
DictionaryTable
getObjectFromDictionaryTable()method 
public static function getObjectFromDictionaryTable(dt:DictionaryTable, obj:Class):IBasicObject

Creates an object and fill it by mapping the DictionaryTable key/value pairs to the object accessors.

Parameters
dt:DictionaryTable
 
obj:Class

Returns
IBasicObject
recursiveAccessorsGet()method 
public static function recursiveAccessorsGet(dt:DictionaryTable, obj:IBasicObject, key:String = ""):IBasicObject

Unserializes an object from a DictionaryTable using keyRoot as the root property path.

Parameters
dt:DictionaryTable
 
obj:IBasicObject
 
key:String (default = "")

Returns
IBasicObject
recursiveAccessorsPut()method 
public static function recursiveAccessorsPut(dt:DictionaryTable, obj:IBasicObject, keyRoot:String = "", keepObjects:Boolean = false):void

Serializes an object to a DictionaryTable using keyRoot as the root property path.

Parameters
dt:DictionaryTable
 
obj:IBasicObject
 
keyRoot:String (default = "")
 
keepObjects:Boolean (default = false)
registerSubTypeMapping()method 
public static function registerSubTypeMapping(type:String, clazz:Class, ignoreRecursion:Boolean = false):void

Registers a type mapping used to instantiate sub-objects while using getObjectFromDictionaryTable method. Useful only while serializing objects to DictionaryTable instances, and the subobjects are interfaces. e.g :

Parameters
type:String
 
clazz:Class
 
ignoreRecursion:Boolean (default = false)

See also


Example
dt.registerSubTypeMapping( "com.sample.company.ICustomerVO" , CustomerVO );

Constant detail
PROPERTY_SEPARATORconstant
public static const PROPERTY_SEPARATOR:String = "$"

The separator used to when flattening an IBasicObject.