Packageorg.spicefactory.parsley.command
Classpublic class MappedCommands
InheritanceMappedCommands Inheritance Object

API for mapping commands to messages programmatically.



Public Methods
 MethodDefined By
  
[static] Creates a new mapping builder for the specified command type.
MappedCommands
  
factoryFunction(factory:Function, type:Class):MappedCommandBuilder
[static] Creates a new mapping builder for the specified factory function.
MappedCommands
Method Detail
create()method
public static function create(type:Class):MappedCommandBuilder

Creates a new mapping builder for the specified command type.

Parameters

type:Class

Returns
MappedCommandBuilder — a new mapping builder for the specified command type
factoryFunction()method 
public static function factoryFunction(factory:Function, type:Class):MappedCommandBuilder

Creates a new mapping builder for the specified factory function. The factory function should not expect any arguments and create a new command instance on each invocation. It will get invoked for each matching message that triggers a command execution.

Parameters

factory:Function — the factory function for creating new command instances
 
type:Class — the type of command the factory creates

Returns
MappedCommandBuilder