Packagecom.soma.core.mediator
Classpublic class SomaMediators
InheritanceSomaMediators Inheritance Object

Author: Romuald Quantin - www.soundstep.com

Resources: http://www.soundstep.com/downloads/somacore

Actionscript version: 3.0

Copyright: Mozilla Public License 1.1 (MPL 1.1) http://www.opensource.org/licenses/mozilla1.1.php

The SomaMediators class handles the mediators of the application. See the Mediator class documentation for implementation.

See also

com.soma.core.mediator.Mediator


Public Methods
 MethodDefined By
  
Create an instance of the SomaWires class.
SomaMediators
  
dispose():void
Destroys all the mediators and properties.
SomaMediators
  
Retrieves a mediator instance using its view.
SomaMediators
  
hasMediator(view:Object):Boolean
Indicates wether a mediator has been created by the framework for a specific view.
SomaMediators
  
isMapped(viewClass:Class):Boolean
Indicates wether a view Class has a mapping rule.
SomaMediators
  
mapView(viewClass:Class, mediatorClass:Class):void
Map a mediator Class to a view Class.
SomaMediators
  
removeMapping(viewClass:Class):void
Remove a mapping rule for a specific Class.
SomaMediators
Constructor Detail
SomaMediators()Constructor
public function SomaMediators(instance:ISoma)

Create an instance of the SomaWires class. Should not be directly instantiated, the framework will instantiate the class.

Parameters
instance:ISoma — Framework instance.
Method Detail
dispose()method
public function dispose():void

Destroys all the mediators and properties. The class will call the dispose method of each mediator instance.

getMediatorByView()method 
public function getMediatorByView(view:Object):IMediator

Retrieves a mediator instance using its view.

Parameters

view:Object — View that the mediator represents.

Returns
IMediator — A mediator instance.

Example
var mediator:MyViewMediator = mediators.getMediatorByView(myView) as MyViewMediator;
hasMediator()method 
public function hasMediator(view:Object):Boolean

Indicates wether a mediator has been created by the framework for a specific view.

Parameters

view:Object — View that the mediator represents.

Returns
Boolean — A Boolean.

Example
mediators.hasMediator(myView);
isMapped()method 
public function isMapped(viewClass:Class):Boolean

Indicates wether a view Class has a mapping rule.

Parameters

viewClass:Class — A Class.

Returns
Boolean — A Boolean.

Example
mediators.isMapped(MyView);
mapView()method 
public function mapView(viewClass:Class, mediatorClass:Class):void

Map a mediator Class to a view Class.

Parameters

viewClass:Class — A Class.
 
mediatorClass:Class — A Class.


Example
mediators.mapView(MyView, MyViewMediator);
removeMapping()method 
public function removeMapping(viewClass:Class):void

Remove a mapping rule for a specific Class.

Parameters

viewClass:Class — A Class.


Example
mediators.removeMapping(MyView);