Package | org.spicefactory.lib.command.light |
Class | public class LightCommandAdapter |
Inheritance | LightCommandAdapter AbstractSuspendableCommand AbstractCancellableCommand AbstractAsyncCommand flash.events.EventDispatcher |
Implements | CommandAdapter |
Such a light command does not implement any of the Command interfaces. It has a required method
called execute
that may expect data to be passed to it through its method parameters.
It supports an optional no-arg cancel
method. For asynchronous operation it supports
a callback function that is either passed to the execute method or injected into a public property
called callback
.
Property | Defined By | ||
---|---|---|---|
active : Boolean [read-only]
Indicates whether this command is currently executing. | AbstractAsyncCommand | ||
cancellable : Boolean [read-only]
Indicates whether this executor can be cancelled. | LightCommandAdapter | ||
suspendable : Boolean [read-only]
Indicates whether this executor can be suspended. | LightCommandAdapter | ||
suspended : Boolean [read-only]
Indicates whether this command is currently suspended. | AbstractSuspendableCommand | ||
target : Object [read-only]
The target executed by this adapter. | LightCommandAdapter |
Property | Defined By | ||
---|---|---|---|
data : CommandData [read-only]
The data associated with this executor. | LightCommandAdapter | ||
lifecycle : CommandLifecycle [read-only]
The lifecycle hook to use for the commands executed by this instance. | LightCommandAdapter |
Method | Defined By | ||
---|---|---|---|
LightCommandAdapter(target:Object, executeMethod:Method, callback:Property, cancelMethod:Method, resultMethod:Method, errorMethod:Method, async:Boolean)
Creates a new instance. | LightCommandAdapter | ||
addErrorType(type:Class):void [static]
Adds a type of result that should be interpreted as an Error. | LightCommandAdapter | ||
cancel():void
Cancels the command. | AbstractCancellableCommand | ||
execute():void
Starts the execution of this command. | AbstractAsyncCommand | ||
isErrorType(result:Object):Boolean [static]
Indicates whether the specified result value represents a known
error type. | LightCommandAdapter | ||
Method that may be called by frameworks before executing this command to hook
into the lifecycle and data handling of this executor. | LightCommandAdapter | ||
resume():void
Resumes the command. | AbstractSuspendableCommand | ||
suspend():void
Suspends the command. | AbstractSuspendableCommand |
cancellable | property |
cancellable:Boolean
[read-only] Indicates whether this executor can be cancelled.
This property should be true when all currently active commands can be cancelled.
public function get cancellable():Boolean
data | property |
data:CommandData
[read-only] The data associated with this executor. Contains any results from previously executed commands or data specified upfront.
protected function get data():CommandData
lifecycle | property |
lifecycle:CommandLifecycle
[read-only] The lifecycle hook to use for the commands executed by this instance.
protected function get lifecycle():CommandLifecycle
suspendable | property |
suspendable:Boolean
[read-only] Indicates whether this executor can be suspended.
This property should be true when all currently active commands can be suspended.
public function get suspendable():Boolean
target | property |
target:Object
[read-only] The target executed by this adapter.
public function get target():Object
LightCommandAdapter | () | Constructor |
public function LightCommandAdapter(target:Object, executeMethod:Method, callback:Property, cancelMethod:Method, resultMethod:Method, errorMethod:Method, async:Boolean)
Creates a new instance.
Parameterstarget:Object — the target command instance
| |
executeMethod:Method — the method to invoke when the command gets executed
| |
callback:Property — the optional callback property to inject a callback function into
| |
cancelMethod:Method — the optional cancel method to invoke whent the command gets cancelled
| |
resultMethod:Method — flag indicating whether this command executes asynchronously
| |
errorMethod:Method | |
async:Boolean |
addErrorType | () | method |
public static function addErrorType(type:Class):void
Adds a type of result that should be interpreted as an Error.
Parameters
type:Class — type of result that should be interpreted as an Error
|
isErrorType | () | method |
public static function isErrorType(result:Object):Boolean
Indicates whether the specified result value represents a known error type.
Parameters
result:Object — the result instance to check
|
Boolean — true if the specified result value represents a known
error type
|
prepare | () | method |
public function prepare(lifecycle:CommandLifecycle, data:CommandData):void
Method that may be called by frameworks before executing this command to hook into the lifecycle and data handling of this executor.
Parameters
lifecycle:CommandLifecycle — the lifecycle hooks this executor should use
| |
data:CommandData — data that can be passed to commands executed by this instance
|