Packagecom.soma.core.wire
Classpublic class SomaWires
InheritanceSomaWires 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 SomaWires class handles the wires of the application. See the Wire class documentation for implementation.

See also

com.soma.core.wire.Wire


Protected Properties
 PropertyDefined By
  wires : Dictionary
List of the wires registered to the framework.
SomaWires
Public Methods
 MethodDefined By
  
SomaWires(instance:ISoma)
Create an instance of the SomaWires class.
SomaWires
  
addWire(wireName:String, wire:IWire):IWire
Registers a wire to the framework.
SomaWires
  
dispose():void
Destroys all the models and properties.
SomaWires
  
getWire(wireName:String):IWire
Retrieves the wire instance that has been registered using its name.
SomaWires
  
getWires():Dictionary
Retrieves all the wire instances that have been registered to the framework.
SomaWires
  
hasWire(wireName:String):Boolean
Indicates wether a wire has been registered to the framework.
SomaWires
  
removeWire(wireName:String):void
Removes a wire from the framework and call the dispose method of this wire.
SomaWires
Property Detail
wiresproperty
protected var wires:Dictionary

List of the wires registered to the framework.

Constructor Detail
SomaWires()Constructor
public function SomaWires(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
addWire()method
public function addWire(wireName:String, wire:IWire):IWire

Registers a wire to the framework.

Parameters

wireName:String — Name of the wire.
 
wire:IWire — Instance of the wire.

Returns
IWire — The wire instance.

Example
addWire(MyWire.NAME, new MyWire());
dispose()method 
public function dispose():void

Destroys all the models and properties. The class will call the dispose method of each model instance.

getWire()method 
public function getWire(wireName:String):IWire

Retrieves the wire instance that has been registered using its name.

Parameters

wireName:String — Name of the wire.

Returns
IWire — A wire instance.

Example
var myWire:MyWire = getWire(MyWire.NAME) as MyWire;
getWires()method 
public function getWires():Dictionary

Retrieves all the wire instances that have been registered to the framework.

Returns
Dictionary — A Dictionary (the key of the Dictionary is the name used for the registration).

Example
var wires:Dictionary = getWires();
hasWire()method 
public function hasWire(wireName:String):Boolean

Indicates wether a wire has been registered to the framework.

Parameters

wireName:String — Name of the wire.

Returns
Boolean — A Boolean.

Example
hasWire(MyWire.NAME);
removeWire()method 
public function removeWire(wireName:String):void

Removes a wire from the framework and call the dispose method of this wire.

Parameters

wireName:String — Name of the wire.


Example
removeWire(MyWire.NAME);