Packageorg.mvcexpress.core
Classpublic class CommandMap
InheritanceCommandMap Inheritance Object

Handles command mappings, and executes them on messages



Public Methods
 MethodDefined By
  
CommandMap($moduleName:String, $messenger:Messenger, $proxyMap:ProxyMap, $mediatorMap:MediatorMap)
CONSTRUCTOR
CommandMap
  
checkIsClassPooled(commandClass:Class):Boolean
Checks if PooledCommand is already pooled.
CommandMap
  
clearCommandPool(commandClass:Class):void
Clears pool created for specified command.
CommandMap
  
execute(commandClass:Class, params:Object = null):void
Instantiates and executes provided command class, and sends params to it.
CommandMap
  
isMapped(type:String, commandClass:Class):Boolean
Checks if Command class is already added to message type
CommandMap
  
listMappings():String
Returns text of all command classes that are mapped to messages.
CommandMap
  
map(type:String, commandClass:Class):void
Map a class to be executed then message with provided type is sent.
CommandMap
  
scopeMap(scopeName:String, type:String, commandClass:Class):void
Maps a class for module to module communication, to be executed then message with provided type and scopeName is sent to scope.
CommandMap
  
scopeUnmap(scopeName:String, type:String, commandClass:Class):void
Unmaps a class for module to module communication, to be executed then message with provided type and scopeName is sent to scope.
CommandMap
  
unmap(type:String, commandClass:Class):void
Unmaps a class to be executed then message with provided type is sent.
CommandMap
Constructor Detail
CommandMap()Constructor
public function CommandMap($moduleName:String, $messenger:Messenger, $proxyMap:ProxyMap, $mediatorMap:MediatorMap)

CONSTRUCTOR

Parameters
$moduleName:String
 
$messenger:Messenger
 
$proxyMap:ProxyMap
 
$mediatorMap:MediatorMap
Method Detail
checkIsClassPooled()method
public function checkIsClassPooled(commandClass:Class):Boolean

Checks if PooledCommand is already pooled.

Parameters

commandClass:Class

Returns
Boolean — true if command pool is created.
clearCommandPool()method 
public function clearCommandPool(commandClass:Class):void

Clears pool created for specified command. (if commands are not pooled - function fails silently.)

Parameters

commandClass:Class

execute()method 
public function execute(commandClass:Class, params:Object = null):void

Instantiates and executes provided command class, and sends params to it.

Parameters

commandClass:Class — Command class to be instantiated and executed.
 
params:Object (default = null) — Object to be sent to execute() function.

handleCommandExecute()method 
pureLegsCore function handleCommandExecute(messageType:String, params:Object):void

function to be called by messenger on needed message type sent

Parameters

messageType:String
 
params:Object

isMapped()method 
public function isMapped(type:String, commandClass:Class):Boolean

Checks if Command class is already added to message type

Parameters

type:String — Message type for command class to react to.
 
commandClass:Class — Command class that will be instantiated and executed.

Returns
Boolean — true if Command class is already mapped to message
listMappings()method 
public function listMappings():String

Returns text of all command classes that are mapped to messages. (for debugging)

Returns
String — Text with all mapped commands.
listMessageCommands()method 
pureLegsCore function listMessageCommands(messageType:String):Vector.<Class>

Parameters

messageType:String

Returns
Vector.<Class>
map()method 
public function map(type:String, commandClass:Class):void

Map a class to be executed then message with provided type is sent.

Parameters

type:String — Message type for command class to react to.
 
commandClass:Class — Command class that will be executed.

scopeMap()method 
public function scopeMap(scopeName:String, type:String, commandClass:Class):void

Maps a class for module to module communication, to be executed then message with provided type and scopeName is sent to scope.

Parameters

scopeName:String — both sending and receiving modules must use same scope to make module to module communication.
 
type:String — Message type for command class to react to.
 
commandClass:Class — Command class that will be executed.

scopeUnmap()method 
public function scopeUnmap(scopeName:String, type:String, commandClass:Class):void

Unmaps a class for module to module communication, to be executed then message with provided type and scopeName is sent to scope.

Parameters

scopeName:String — both sending and receiving modules must use same scope to make module to module communication.
 
type:String — Message type for command class to react to.
 
commandClass:Class — Command class that would be executed.

unmap()method 
public function unmap(type:String, commandClass:Class):void

Unmaps a class to be executed then message with provided type is sent.

Parameters

type:String — Message type for command class to react to.
 
commandClass:Class — Command class that would be executed.