Package | org.spicefactory.lib.command.adapter |
Class | public class CommandAdapters |
Inheritance | CommandAdapters Object |
Method | Defined By | ||
---|---|---|---|
addFactory(factory:CommandAdapterFactory, order:int = 2147483647):void [static]
Adds a factory to this registry. | CommandAdapters | ||
createAdapter(instance:Object, domain:ApplicationDomain = null):CommandAdapter [static]
Creates a new adapter for the specified target command. | CommandAdapters |
addFactory | () | method |
public static function addFactory(factory:CommandAdapterFactory, order:int = 2147483647):void
Adds a factory to this registry. The order attributes allows to sort all available factories. For each new command instance that does not implement one of the command interfaces the factories get asked to create a new adapter in the specified order until one factory was able to handle the command (Chain of Responsibility).
Parameters
factory:CommandAdapterFactory — factory to add to this registry.
| |
order:int (default = 2147483647 ) — the order to use for this factory
|
createAdapter | () | method |
public static function createAdapter(instance:Object, domain:ApplicationDomain = null):CommandAdapter
Creates a new adapter for the specified target command. Throws an error if the instance cannot be handled by any of the available adapters
Parameters
instance:Object — the target command that usually does not implement one of the Command interfaces
| |
domain:ApplicationDomain (default = null ) — the ApplicationDomain to use for reflection
|
CommandAdapter — a new adapter for the specified target command
|