Package | org.spicefactory.lib.command.builder |
Class | public class CommandGroupBuilder |
Inheritance | CommandGroupBuilder AbstractCommandBuilder Object |
Method | Defined By | ||
---|---|---|---|
add(command:Object):CommandGroupBuilder
Adds a new command instance to this group. | CommandGroupBuilder | ||
allResults(callback:Function):CommandGroupBuilder
Adds a callback to invoke when the command group completes successfully. | CommandGroupBuilder | ||
[override]
Builds the target command, applying all configurations specified
through this builder instance. | CommandGroupBuilder | ||
cancel(callback:Function):CommandGroupBuilder
Adds a callback to invoke when the command group gets cancelled. | CommandGroupBuilder | ||
create(commandType:Class):CommandGroupBuilder
Adds a new command type to this group. | CommandGroupBuilder | ||
data(value:Object):CommandGroupBuilder
Adds a value that can get passed to any command
executed by the group this builder creates. | CommandGroupBuilder | ||
description(description:String, ... params):CommandGroupBuilder
A description of the command group produced by this builder. | CommandGroupBuilder | ||
domain(domain:ApplicationDomain):CommandGroupBuilder
The domain to use for reflecting on command classes. | CommandGroupBuilder | ||
error(callback:Function):CommandGroupBuilder
Adds a callback to invoke when the command group produced an error. | CommandGroupBuilder | ||
Builds and executes the target command. | AbstractCommandBuilder | ||
lastResult(callback:Function):CommandGroupBuilder
Adds a callback to invoke when the command group completes successfully. | CommandGroupBuilder | ||
Instructs the group to ignore cancellations of any of its commands
and treat them the same way as successful completion. | CommandGroupBuilder | ||
Instructs the group to ignore errors produced by any of its commands
and treat them the same way as successful completion. | CommandGroupBuilder | ||
timeout(milliseconds:uint):CommandGroupBuilder
Sets the timeout for the group. | CommandGroupBuilder |
add | () | method |
public function add(command:Object):CommandGroupBuilder
Adds a new command instance to this group.
Parameters
command:Object — the command to add to this group
|
CommandGroupBuilder — this builder instance for method chaining
|
allResults | () | method |
public function allResults(callback:Function):CommandGroupBuilder
Adds a callback to invoke when the command group completes successfully.
An instance of CommandResult
will get passed to the callback
holding all results produced by the commands in the group.
Parameters
callback:Function — the callback to invoke when the command group completes successfully
|
CommandGroupBuilder — this builder instance for method chaining
|
build | () | method |
override public function build():CommandProxy
Builds the target command, applying all configurations specified through this builder instance.
ReturnsCommandProxy — the command proxy will all configuration of this builder applied
|
cancel | () | method |
public function cancel(callback:Function):CommandGroupBuilder
Adds a callback to invoke when the command group gets cancelled. The callback should not expect any parameters.
Parameters
callback:Function — the callback to invoke when the command group gets cancelled
|
CommandGroupBuilder — this builder instance for method chaining
|
create | () | method |
public function create(commandType:Class):CommandGroupBuilder
Adds a new command type to this group.
Parameters
commandType:Class — the command type to add to this group
|
CommandGroupBuilder — this builder instance for method chaining
|
data | () | method |
public function data(value:Object):CommandGroupBuilder
Adds a value that can get passed to any command executed by the group this builder creates.
Parameters
value:Object — the value to pass to the command group
|
CommandGroupBuilder — this builder instance for method chaining
|
description | () | method |
public function description(description:String, ... params):CommandGroupBuilder
A description of the command group produced by this builder.
Parameters
description:String — a description of the command group produced by this builder
| |
... params — parameters to insert into the description in case in contains placeholders (like {0})
|
CommandGroupBuilder — this builder instance for method chaining
|
domain | () | method |
public function domain(domain:ApplicationDomain):CommandGroupBuilder
The domain to use for reflecting on command classes.
Parameters
domain:ApplicationDomain — the domain to use for reflecting on command classes
|
CommandGroupBuilder — this builder instance for method chaining
|
error | () | method |
public function error(callback:Function):CommandGroupBuilder
Adds a callback to invoke when the command group produced an error. The cause of the error will get passed to the callback.
Parameters
callback:Function — the callback to invoke when the command group produced an error
|
CommandGroupBuilder — this builder instance for method chaining
|
lastResult | () | method |
public function lastResult(callback:Function):CommandGroupBuilder
Adds a callback to invoke when the command group completes successfully. The result produced by the last command in the group will get passed to the callback. It is not recommended to use this callback in case of parallel execution as the type of result passed to the callback might be different for each execution.
Parameters
callback:Function — the callback to invoke when the command group completes successfully
|
CommandGroupBuilder — this builder instance for method chaining
|
skipCancellations | () | method |
public function skipCancellations():CommandGroupBuilder
Instructs the group to ignore cancellations of any of its commands and treat them the same way as successful completion. Without invoking this method the entire group will get cancelled when any one command it executes gets cancelled.
ReturnsCommandGroupBuilder — this builder instance for method chaining
|
skipErrors | () | method |
public function skipErrors():CommandGroupBuilder
Instructs the group to ignore errors produced by any of its commands and treat them the same way as successful completion. Without invoking this method the group will abort with an error when any one command it executes produces an error.
ReturnsCommandGroupBuilder — this builder instance for method chaining
|
timeout | () | method |
public function timeout(milliseconds:uint):CommandGroupBuilder
Sets the timeout for the group. When the specified amount of time is elapsed the group execution will abort with an error.
Parameters
milliseconds:uint — the timeout for this group in milliseconds
|
CommandGroupBuilder — this builder instance for method chaining
|