Packageorg.robotlegs.base
Classpublic class MediatorMap
InheritanceMediatorMap Inheritance ViewMapBase Inheritance Object
Implements IMediatorMap

An abstract IMediatorMap implementation



Public Properties
 PropertyDefined By
 InheritedcontextView : DisplayObjectContainer
ViewMapBase
 Inheritedenabled : Boolean
ViewMapBase
Public Methods
 MethodDefined By
  
MediatorMap(contextView:DisplayObjectContainer, injector:IInjector, reflector:IReflector)
Creates a new MediatorMap object
MediatorMap
  
createMediator(viewComponent:Object):IMediator
Create an instance of a mapped IMediator This will instantiate and register a Mediator for a given View Component.
MediatorMap
  
hasMapping(viewClassOrName:*):Boolean
Check if the view Class has been mapped or not
MediatorMap
  
hasMediator(mediator:IMediator):Boolean
Check if the IMediator has been registered
MediatorMap
  
hasMediatorForView(viewComponent:Object):Boolean
Check if an IMediator has been registered for a view instance
MediatorMap
  
mapView(viewClassOrName:*, mediatorClass:Class, injectViewAs:* = null, autoCreate:Boolean = true, autoRemove:Boolean = true):void
Map an IMediator to a view Class
MediatorMap
  
registerMediator(viewComponent:Object, mediator:IMediator):void
Manually register an IMediator instance NOTE: Registering a Mediator will NOT inject its dependencies.
MediatorMap
  
Remove a registered IMediator instance
MediatorMap
  
removeMediatorByView(viewComponent:Object):IMediator
Remove a registered IMediator instance
MediatorMap
  
retrieveMediator(viewComponent:Object):IMediator
Retrieve a registered IMediator instance
MediatorMap
  
unmapView(viewClassOrName:*):void
Unmap a view Class
MediatorMap
Protected Methods
 MethodDefined By
  
onViewRemoved(e:Event):void
Flex framework work-around part #5
MediatorMap
  
removeMediatorLater(event:Event):void
Flex framework work-around part #6
MediatorMap
Constructor Detail
MediatorMap()Constructor
public function MediatorMap(contextView:DisplayObjectContainer, injector:IInjector, reflector:IReflector)

Creates a new MediatorMap object

Parameters
contextView:DisplayObjectContainer — The root view node of the context. The map will listen for ADDED_TO_STAGE events on this node
 
injector:IInjector — An IInjector to use for this context
 
reflector:IReflector — An IReflector to use for this context
Method Detail
createMediator()method
public function createMediator(viewComponent:Object):IMediator

Create an instance of a mapped IMediator

This will instantiate and register a Mediator for a given View Component. Mediator dependencies will be automatically resolved.

Parameters

viewComponent:Object — An instance of the view Class previously mapped to an IMediator Class

Returns
IMediator — The IMediator
hasMapping()method 
public function hasMapping(viewClassOrName:*):Boolean

Check if the view Class has been mapped or not

Parameters

viewClassOrName:* — The concrete view Class or Fully Qualified Class Name

Returns
Boolean — Whether this view class has been mapped
hasMediator()method 
public function hasMediator(mediator:IMediator):Boolean

Check if the IMediator has been registered

Parameters

mediator:IMediator — The IMediator instance

Returns
Boolean — Whether this IMediator has been registered
hasMediatorForView()method 
public function hasMediatorForView(viewComponent:Object):Boolean

Check if an IMediator has been registered for a view instance

Parameters

viewComponent:Object — The view that the IMediator was registered with

Returns
Boolean — Whether an IMediator has been registered for this view instance
mapView()method 
public function mapView(viewClassOrName:*, mediatorClass:Class, injectViewAs:* = null, autoCreate:Boolean = true, autoRemove:Boolean = true):void

Map an IMediator to a view Class

Parameters

viewClassOrName:* — The concrete view Class or Fully Qualified Class Name
 
mediatorClass:Class — The IMediator Class
 
injectViewAs:* (default = null) — The explicit view Interface or Class that the mediator depends on OR an Array of such Interfaces/Classes.
 
autoCreate:Boolean (default = true) — Automatically construct and register an instance of Class mediatorClass when an instance of Class viewClass is detected
 
autoRemove:Boolean (default = true) — Automatically remove an instance of Class mediatorClass when its viewClass leaves the ancestory of the context view

onViewRemoved()method 
protected function onViewRemoved(e:Event):void

Flex framework work-around part #5

Parameters

e:Event

registerMediator()method 
public function registerMediator(viewComponent:Object, mediator:IMediator):void

Manually register an IMediator instance

NOTE: Registering a Mediator will NOT inject its dependencies. It is assumed that dependencies are already satisfied.

Parameters

viewComponent:Object — The view component for the IMediator
 
mediator:IMediator — The IMediator to register

removeMediator()method 
public function removeMediator(mediator:IMediator):IMediator

Remove a registered IMediator instance

Parameters

mediator:IMediator — The IMediator to remove

Returns
IMediator — The IMediator that was removed
removeMediatorByView()method 
public function removeMediatorByView(viewComponent:Object):IMediator

Remove a registered IMediator instance

Parameters

viewComponent:Object — The view that the IMediator was registered with

Returns
IMediator — The IMediator that was removed
removeMediatorLater()method 
protected function removeMediatorLater(event:Event):void

Flex framework work-around part #6

Parameters

event:Event

retrieveMediator()method 
public function retrieveMediator(viewComponent:Object):IMediator

Retrieve a registered IMediator instance

Parameters

viewComponent:Object — The view that the IMediator was registered with

Returns
IMediator — The IMediator
unmapView()method 
public function unmapView(viewClassOrName:*):void

Unmap a view Class

Parameters

viewClassOrName:* — The concrete view Class or Fully Qualified Class Name