interface ICommandMapper
package com.domwires.core.mvc.command
extends IDisposable, ICommandMapperImmutable
extended by CommandMapper, IContext
Maps specific messages to ICommand
.
Methods
executeCommand(commandClass:Class<ICommand>, ?data:Dynamic, ?guardList:Array<Class<IGuards>>, ?guardNotList:Array<Class<IGuards>>):Bool
Execute command manually.
Parameters:
commandClass | |
---|---|
data | Plain data object, which properties will be injected into |
guardList | List of guards, that will allow or not command execution |
guardNotList | List of opposite guards |
map(messageType:EnumValue, commandClass:Class<ICommand>, ?data:Dynamic, once:Bool = false, stopOnExecute:Bool = false):MappingConfig
Maps message to command. When message occurred, specified command will be implemented.
Parameters:
messageType | |
---|---|
commandClass | |
data | Plain data object, which properties will be injected into |
once | Messaged will be automatically unmapped, after command execution |
stopOnExecute | If true, |
map1(messageType:EnumValue, commandClassList:Array<Class<ICommand>>, ?data:Dynamic, once:Bool = false, stopOnExecute:Bool = false):MappingConfigList
See also:
map
map2(messageTypeList:Array<EnumValue>, commandClass:Class<ICommand>, ?data:Dynamic, once:Bool = false, stopOnExecute:Bool = false):MappingConfigList
See also:
map
map3(messageTypeList:Array<EnumValue>, commandClassList:Array<Class<ICommand>>, ?data:Dynamic, once:Bool = false, stopOnExecute:Bool = false):MappingConfigList
See also:
map
setMergeMessageDataAndMappingData(value:Bool):ICommandMapper
If true, then message data object will be merged with mapping data object. Mapping data will be in priority. Otherwise mapping data will be replaced by message data (if has one). By default is false, and mapping data will be replaced with message data (if has one).
Parameters:
null | value |
---|
tryToExecuteCommand(message:IMessage):Void
Trying to find and execute commands, mapped to current message type.
Parameters:
null | message |
---|
unmap(messageType:EnumValue, commandClass:Class<ICommand>):ICommandMapper
Unmaps message from command.
Parameters:
messageType | |
---|---|
null | commandClass |
unmapAll(messageType:EnumValue):ICommandMapper
Unmaps all commands from specified message.
Parameters:
null | messageType |
---|