Packageorg.robotlegs.core
Interfacepublic interface IMediatorMap
Implementors MediatorMap

The Robotlegs MediatorMap contract



Public Properties
 PropertyDefined By
  contextView : DisplayObjectContainer
The IMediatorMap's DisplayObjectContainer
IMediatorMap
  enabled : Boolean
The IMediatorMap's enabled status
IMediatorMap
Public Methods
 MethodDefined By
  
createMediator(viewComponent:Object):IMediator
Create an instance of a mapped IMediator This will instantiate and register a Mediator for a given View Component.
IMediatorMap
  
hasMapping(viewClassOrName:*):Boolean
Check if the view Class has been mapped or not
IMediatorMap
  
hasMediator(mediator:IMediator):Boolean
Check if the IMediator has been registered
IMediatorMap
  
hasMediatorForView(viewComponent:Object):Boolean
Check if an IMediator has been registered for a view instance
IMediatorMap
  
mapView(viewClassOrName:*, mediatorClass:Class, injectViewAs:* = null, autoCreate:Boolean = true, autoRemove:Boolean = true):void
Map an IMediator to a view Class
IMediatorMap
  
registerMediator(viewComponent:Object, mediator:IMediator):void
Manually register an IMediator instance NOTE: Registering a Mediator will NOT inject its dependencies.
IMediatorMap
  
Remove a registered IMediator instance
IMediatorMap
  
removeMediatorByView(viewComponent:Object):IMediator
Remove a registered IMediator instance
IMediatorMap
  
retrieveMediator(viewComponent:Object):IMediator
Retrieve a registered IMediator instance
IMediatorMap
  
unmapView(viewClassOrName:*):void
Unmap a view Class
IMediatorMap
Property Detail
contextViewproperty
contextView:DisplayObjectContainer

The IMediatorMap's DisplayObjectContainer


Implementation
    public function get contextView():DisplayObjectContainer
    public function set contextView(value:DisplayObjectContainer):void
enabledproperty 
enabled:Boolean

The IMediatorMap's enabled status


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
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

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
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