| Package | org.springextensions.actionscript.ioc.factory |
| Interface | public interface IObjectFactory extends IObjectDefinitionRegistryAware, flash.events.IEventDispatcher |
| Implementors | DefaultObjectFactory |
| Property | Defined By | ||
|---|---|---|---|
| applicationDomain : ApplicationDomain
The ApplicationDomain that is associated with the current IObjectFactory
| IObjectFactory | ||
| cache : IInstanceCache [read-only]
An IInstanceCache instance used to hold the singletons created by the current IObjectFactory. | IObjectFactory | ||
| dependencyInjector : IDependencyInjector | IObjectFactory | ||
| isReady : Boolean
Returns true when the current IObjectFactory is fully initialized and ready for use. | IObjectFactory | ||
![]() | objectDefinitionRegistry : IObjectDefinitionRegistry | IObjectDefinitionRegistryAware | |
| objectDestroyer : IObjectDestroyer | IObjectFactory | ||
| objectPostProcessors : Vector.<IObjectPostProcessor> [read-only]
| IObjectFactory | ||
| parent : IObjectFactory
Optional parent factory that can be used to create objects that can't be created by the current instance. | IObjectFactory | ||
| propertiesProvider : IPropertiesProvider | IObjectFactory | ||
| referenceResolvers : Vector.<IReferenceResolver> [read-only]
| IObjectFactory | ||
| Method | Defined By | ||
|---|---|---|---|
| IObjectFactory | |||
| IObjectFactory | |||
canCreate(objectName:String):Boolean
Determines if the current ObjectFactory is able to create the object for the sepcified object name. | IObjectFactory | ||
createInstance(clazz:Class, constructorArguments:Array = null):*
Creates an instance of the specified Class, wires the instance and returns it. | IObjectFactory | ||
destroyObject(instance:Object):void | IObjectFactory | ||
getObject(name:String, constructorArguments:Array = null):*
Will retrieve an object by it's name/id If the definition is a singleton it will be retrieved from
cache if possible. | IObjectFactory | ||
getObjectDefinition(objectName:String):IObjectDefinition | IObjectFactory | ||
resolveReference(reference:*):* | IObjectFactory | ||
resolveReferences(references:Array):Array | IObjectFactory | ||
| applicationDomain | property |
applicationDomain:ApplicationDomain
The ApplicationDomain that is associated with the current IObjectFactory
public function get applicationDomain():ApplicationDomain public function set applicationDomain(value:ApplicationDomain):void| cache | property |
cache:IInstanceCache [read-only]
An IInstanceCache instance used to hold the singletons created by the current IObjectFactory.
public function get cache():IInstanceCache| dependencyInjector | property |
dependencyInjector:IDependencyInjector
public function get dependencyInjector():IDependencyInjector public function set dependencyInjector(value:IDependencyInjector):void| isReady | property |
isReady:Boolean
Returns true when the current IObjectFactory is fully initialized and ready for use.
public function get isReady():Boolean public function set isReady(value:Boolean):void| objectDestroyer | property |
objectDestroyer:IObjectDestroyer
public function get objectDestroyer():IObjectDestroyer public function set objectDestroyer(value:IObjectDestroyer):void| objectPostProcessors | property |
objectPostProcessors:Vector.<IObjectPostProcessor> [read-only]
public function get objectPostProcessors():Vector.<IObjectPostProcessor>| parent | property |
parent:IObjectFactoryOptional parent factory that can be used to create objects that can't be created by the current instance.
public function get parent():IObjectFactory public function set parent(value:IObjectFactory):void| propertiesProvider | property |
propertiesProvider:IPropertiesProvider
public function get propertiesProvider():IPropertiesProvider public function set propertiesProvider(value:IPropertiesProvider):void| referenceResolvers | property |
referenceResolvers:Vector.<IReferenceResolver> [read-only]
public function get referenceResolvers():Vector.<IReferenceResolver>| addObjectPostProcessor | () | method |
public function addObjectPostProcessor(objectPostProcessor:IObjectPostProcessor):IObjectFactory
Parameters
objectPostProcessor:IObjectPostProcessor |
IObjectFactory |
| addReferenceResolver | () | method |
public function addReferenceResolver(referenceResolver:IReferenceResolver):IObjectFactory
Parameters
referenceResolver:IReferenceResolver |
IObjectFactory |
| canCreate | () | method |
public function canCreate(objectName:String):Boolean
Determines if the current ObjectFactory is able to create the object for the sepcified object name.
Parameters
objectName:String — The specified object name
|
Boolean — True if the current ObjectFactory is able to create the object for the sepcified object name.
|
| createInstance | () | method |
public function createInstance(clazz:Class, constructorArguments:Array = null):*
Creates an instance of the specified Class, wires the instance and returns it.
Useful for creating objects that have only been annotated with [Autowired] metadata and need
no object definition.
Parameters
clazz:Class — The specified Class.
| |
constructorArguments:Array (default = null) — Optional Array of constructor arguments to be used for the instance.
|
* — The created and wired instance of the specified Class.
|
| destroyObject | () | method |
public function destroyObject(instance:Object):void
Parameters
instance:Object |
| getObject | () | method |
public function getObject(name:String, constructorArguments:Array = null):*Will retrieve an object by it's name/id If the definition is a singleton it will be retrieved from cache if possible. If the definition defines an init method, the init method will be called after all properties have been set.
If any object post processors are defined they will be run against the newly created instance. The class that is instantiated can implement the following interfaces for a special treatment:IInitializingObject: The method defined by the interface will called after the
properties have been set.IFactoryObject: The actual object will be retrieved using the getObject method.Parameters
name:String — The name of the object as defined in the object definition
| |
constructorArguments:Array (default = null) — The arguments that should be passed to the constructor. Note that
the constructorArguments can only be passed if the object is
defined as lazy.
|
* — An instance of the requested object
|
org.springextensions.actionscript.ioc:ObjectDefinitionNotFoundError — The name of the given object should be
present as an object definition
| |
flash.errors:IllegalOperationError — A singleton object definition that is not lazy
can not be given constructor arguments
| |
org.springextensions.actionscript.errors:PropertyTypeError — The type of a property definition should
match the type of property on the instance
| |
org.springextensions.actionscript.errors:ClassNotFoundError — The class set on the definition should
be compiled into the application
| |
org.springextensions.actionscript.errors:ResolveReferenceError — Indicating a problem resolving the
references of a certain property
|
See also
var myPerson:Person = objectFactory.getObject("myPerson");
| getObjectDefinition | () | method |
public function getObjectDefinition(objectName:String):IObjectDefinition
Parameters
objectName:String |
IObjectDefinition —
|
| resolveReference | () | method |
public function resolveReference(reference:*):*
Parameters
reference:* |
* —
|
| resolveReferences | () | method |
public function resolveReferences(references:Array):Array
Parameters
references:Array |
Array —
|