Packageorg.spicefactory.lib.command.builder
Classpublic class Commands
InheritanceCommands Inheritance Object

Entry point for the builde DSL for configuring and creating new command instances. This DSL exists mainly for convenience. Any command types built by this class can also be created by using their respective target APIs. But using this DSL usually leads to code that is more concise.



Public Methods
 MethodDefined By
  
[static] Creates a new builder for commands to be executed as a flow with decision points between individual commands.
Commands
  
[static] Creates a new builder for commands to be executed as a sequence.
Commands
  
create(commandType:Class):CommandProxyBuilder
[static] Creates a builder for the specified command type.
Commands
  
delay(milliseconds:uint):CommandProxyBuilder
[static] Creates a builder that creates a command that simply waits the specified amount of time before completing.
Commands
  
delegate(commandFunction:Function, ... params):CommandProxyBuilder
[static] Creates a builder for simple delegate that invokes the specified function when the command gets executed.
Commands
  
[static] Creates a new builder for commands to be executed in parallel.
Commands
  
useDomain(domain:ApplicationDomain):void
[static] Specifies a domain to use for reflecting on command classes.
Commands
  
wrap(command:Object):CommandProxyBuilder
[static] Creates a builder for the specified command instance.
Commands
Method Detail
asFlow()method
public static function asFlow():CommandFlowBuilder

Creates a new builder for commands to be executed as a flow with decision points between individual commands.

Returns
CommandFlowBuilder — a new builder for commands to be executed as a flow
asSequence()method 
public static function asSequence():CommandGroupBuilder

Creates a new builder for commands to be executed as a sequence.

Returns
CommandGroupBuilder — a new builder for commands to be executed as a sequence
create()method 
public static function create(commandType:Class):CommandProxyBuilder

Creates a builder for the specified command type. The target type may either be a class that implements the Command interface itself or a type an adapter is registered for that knows how to turn the type into a command.

Parameters

commandType:Class

Returns
CommandProxyBuilder — a new builder for the specified command type
delay()method 
public static function delay(milliseconds:uint):CommandProxyBuilder

Creates a builder that creates a command that simply waits the specified amount of time before completing.

Parameters

milliseconds:uint — the time to wait in milliseconds before the command completion

Returns
CommandProxyBuilder — a new builder for a command that waits the specified amount of time before completing
delegate()method 
public static function delegate(commandFunction:Function, ... params):CommandProxyBuilder

Creates a builder for simple delegate that invokes the specified function when the command gets executed.

Parameters

commandFunction:Function — the function to invoke when the command gets executed
 
... params — parameters to pass to the function

Returns
CommandProxyBuilder — a new builder for the specified command function
inParallel()method 
public static function inParallel():CommandGroupBuilder

Creates a new builder for commands to be executed in parallel.

Returns
CommandGroupBuilder — a new builder for commands to be executed in parallel
useDomain()method 
public static function useDomain(domain:ApplicationDomain):void

Specifies a domain to use for reflecting on command classes. This is a global default that will affect all subsequent commands built by this DSL.

Parameters

domain:ApplicationDomain — the domain to use for reflecting on command classes

wrap()method 
public static function wrap(command:Object):CommandProxyBuilder

Creates a builder for the specified command instance.

Legal parameters are any instances that implement either Command or CommandBuilder, or any other type in case an adapter is registered that knows how to turn the type into a command.

Parameters

command:Object

Returns
CommandProxyBuilder — a new builder for the specified command instance