Packageorg.mvcexpress.base
Classpublic class MediatorMap
InheritanceMediatorMap Inheritance Object
Implements IMediatorMap
Subclasses FlexMediatorMap

Handles application mediators.



Protected Properties
 PropertyDefined By
  classRegistry : Dictionary
MediatorMap
  mediatorRegistry : Dictionary
MediatorMap
  messenger : Messenger
MediatorMap
  proxyMap : ProxyMap
MediatorMap
Public Methods
 MethodDefined By
  
MediatorMap(messenger:Messenger, proxyMap:ProxyMap)
CONSTRUCTOR
MediatorMap
  
isMapped(viewClass:Class, mediatorClass:Class):Boolean
Checks if mediator class is mapped to view class.
MediatorMap
  
isMediated(viewObject:Object):Boolean
Checks if view object is mediated.
MediatorMap
  
listMappings():String
Returns String of all view classes that are mapped to mediator classes.
MediatorMap
  
map(viewClass:Class, mediatorClass:Class):void
Maps mediator class to view class.
MediatorMap
  
mediate(viewObject:Object):void
Mediates provided viewObject with mapped mediator.
MediatorMap
  
unmap(viewClass:Class):void
Unmaps any mediator class to given view class.
MediatorMap
  
unmediate(viewObject:Object):void
If any mediator is mediating viewObject: it calls onRemove on that object, automatically removes all handler functions listening for messages from that mediator and deletes it.
MediatorMap
Property Detail
classRegistryproperty
protected var classRegistry:Dictionary

mediatorRegistryproperty 
protected var mediatorRegistry:Dictionary

messengerproperty 
protected var messenger:Messenger

proxyMapproperty 
protected var proxyMap:ProxyMap

Constructor Detail
MediatorMap()Constructor
public function MediatorMap(messenger:Messenger, proxyMap:ProxyMap)

CONSTRUCTOR

Parameters
messenger:Messenger
 
proxyMap:ProxyMap
Method Detail
isMapped()method
public function isMapped(viewClass:Class, mediatorClass:Class):Boolean

Checks if mediator class is mapped to view class.

Parameters

viewClass:Class — view class that has to be mediated by mediator class then mediate(viewObject) is called.
 
mediatorClass:Class — Mediator class that will be instantiated then viewClass object is passed to mediate function.

Returns
Boolean — true if view class is already mapped to mediator class.
isMediated()method 
public function isMediated(viewObject:Object):Boolean

Checks if view object is mediated.

Parameters

viewObject:Object — View object to check if it is mediated.

Returns
Boolean
listMappings()method 
public function listMappings():String

Returns String of all view classes that are mapped to mediator classes.

Returns
String — Text with all mapped mediators.
map()method 
public function map(viewClass:Class, mediatorClass:Class):void

Maps mediator class to view class. Only one mediator class can mediate single instance of view class.

Parameters

viewClass:Class — view class that has to be mediated by mediator class then mediate() is called.
 
mediatorClass:Class — mediator class that will be instantiated then viewClass object is passed to mediate() function.

mediate()method 
public function mediate(viewObject:Object):void

Mediates provided viewObject with mapped mediator. Automatically instantiates mediator class(if mapped), handles all injections(including viewObject), and calls onRegister function. Throws error if mediator class is not mapped to viewObject class.

Parameters

viewObject:Object — view object to mediate.

unmap()method 
public function unmap(viewClass:Class):void

Unmaps any mediator class to given view class.

Parameters

viewClass:Class — view class to remove mapped mediator class from.

unmediate()method 
public function unmediate(viewObject:Object):void

If any mediator is mediating viewObject: it calls onRemove on that object, automatically removes all handler functions listening for messages from that mediator and deletes it.

Parameters

viewObject:Object — view object witch mediator will be destroyed.