Packageorg.spicefactory.lib.command.adapter
Classpublic class CommandAdapters
InheritanceCommandAdapters Inheritance Object

Central registry for all available command adapters. An adapter must be registered before executing or configuring one of the commands handled by the adapter.



Public Methods
 MethodDefined 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
Method Detail
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

Returns
CommandAdapter — a new adapter for the specified target command