| Package | org.springextensions.actionscript.ioc.factory |
| SVN browsing | IObjectFactory.as |
| Fisheye | IObjectFactory.as |
| Interface | public interface IObjectFactory extends IDependencyInjector, flash.events.IEventDispatcher |
| Subinterfaces | IConfigurableObjectFactory, IListableObjectFactory |
| Implementors | DefaultAutowireProcessor, EventHandlerMetadataProcessor, MetadataProcessorObjectPostProcessor, OwnerModuleObjectPostProcessor, RequiredMetadataProcessor, TypeBasedObjectSelector |
IConfigurableObjectFactory interface.
See also
| Property | Defined by | ||
|---|---|---|---|
| applicationDomain : ApplicationDomain | IObjectFactory | ||
| explicitSingletonNames : Array [read-only]
Returns the names of the explicit singleton objects registered in the factory.
| IObjectFactory | ||
| objectDefinitions : Object [read-only]
A registry of object definitions that describe the way an
IObjectFactory will have to
create and configure objects. | IObjectFactory | ||
| parent : IObjectFactory
Optional parent factory that can be used to create objects that can't be created by the current instance.
| IObjectFactory | ||
| properties : Properties
[read-only]
| IObjectFactory | ||
| Method | Defined by | ||
|---|---|---|---|
|
addReferenceResolver(referenceResolver:IReferenceResolver):void
This method adds a reference resolver that will be used to resolve property
references.
| IObjectFactory | ||
|
canCreate(objectName:String):Boolean
Determines if the object factory is able to create the object with the given name.
| IObjectFactory | ||
|
clearObjectFromInternalCache(name:String):Object
Removes an object from the internal object definition cache.
| IObjectFactory | ||
|
containsObject(objectName:String):Boolean
Determines if the object factory contains a definition with the given name.
| IObjectFactory | ||
|
createInstance(clazz:Class, constructorArguments:Array = null):*
Creates an instance of the specified
Class, wires the instance and returns it. | IObjectFactory | ||
|
getClassForInstance(object:Object):Class
| IObjectFactory | ||
|
getClassForName(className:String):Class
| 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 | ||
|
getType(objectName:String):Class
Returns the type that is defined on the object definition.
| IObjectFactory | ||
|
isPrototype(objectName:String):Boolean
Determines if the definition with the given name is a prototype.
| IObjectFactory | ||
|
isSingleton(objectName:String):Boolean
Determines if the definition with the given name is a singleton.
| IObjectFactory | ||
|
resolveReference(property:Object):Object
Resolves a property in an object definition.
| IObjectFactory | ||
![]() |
wire(object:*, objectDefinition:IObjectDefinition = null, objectName:String = null):void
| IDependencyInjector | |
| applicationDomain | property |
applicationDomain:ApplicationDomain [read-write]Implementation
public function get applicationDomain():ApplicationDomain
public function set applicationDomain(value:ApplicationDomain):void
| explicitSingletonNames | property |
explicitSingletonNames:Array [read-only]Returns the names of the explicit singleton objects registered in the factory. These are objects directly created and managed by the factory that don't have an object definition.
Implementation public function get explicitSingletonNames():Array
| objectDefinitions | property |
objectDefinitions:Object [read-only]
A registry of object definitions that describe the way an IObjectFactory will have to
create and configure objects.
public function get objectDefinitions():Object
| parent | property |
parent:IObjectFactory [read-write]Optional parent factory that can be used to create objects that can't be created by the current instance.
Implementation public function get parent():IObjectFactory
public function set parent(value:IObjectFactory):void
| properties | property |
| addReferenceResolver | () | method |
public function addReferenceResolver(referenceResolver:IReferenceResolver):voidThis method adds a reference resolver that will be used to resolve property references.
ParametersreferenceResolver:IReferenceResolver — The implementation of IReferenceResolver that should be added
|
See also
| canCreate | () | method |
public function canCreate(objectName:String):Boolean
Determines if the object factory is able to create the object with the given name.
This does not necesarrily mean that the current IObjectFactory contains an
object definition for the given name. If a parent factory is assigned this will be checked
as well if the current factory does not contain the necessary object definition.
objectName:String — The name/id of the object definition
|
Boolean — true if the current IObjectFactory is able to create the object with the given name
|
See also
| clearObjectFromInternalCache | () | method |
public function clearObjectFromInternalCache(name:String):ObjectRemoves an object from the internal object definition cache. This cache is used to cache singletons.
Parametersname:String — The name/id of the object to remove
|
Object — the removed object
|
| containsObject | () | method |
public function containsObject(objectName:String):BooleanDetermines if the object factory contains a definition with the given name.
ParametersobjectName:String — The name/id of the object definition
|
Boolean — true if a definition with that name exists
|
See also
| 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.
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.
|
| getClassForInstance | () | method |
public function getClassForInstance(object:Object):ClassParameters
object:Object |
Class |
| getClassForName | () | method |
public function getClassForName(className:String):ClassParameters
className:String |
Class |
| 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.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
|
ObjectDefinitionNotFoundError — The name of the given object should be
present as an object definition
|
|
— An object definition that is not lazy
can not be given constructor arguments
|
|
— The type of a property definition should
match the type of property on the instance
|
|
— The class set on the definition should
be compiled into the application
|
|
— Indicating a problem resolving the
references of a certain property
|
See also
var myPerson:Person = objectFactory.getObject("myPerson");
| getType | () | method |
public function getType(objectName:String):ClassReturns the type that is defined on the object definition.
ParametersobjectName:String — The name/id of the object definition
|
Class — the class that is used to construct the object
|
See also
| isPrototype | () | method |
public function isPrototype(objectName:String):BooleanDetermines if the definition with the given name is a prototype.
ParametersobjectName:String — The name/id of the object definition
|
Boolean — true if the definitions is defined as a prototype
|
See also
| isSingleton | () | method |
public function isSingleton(objectName:String):BooleanDetermines if the definition with the given name is a singleton.
ParametersobjectName:String — The name/id of the object definition
|
Boolean — true if the definitions is defined as a singleton
|
See also
| resolveReference | () | method |
public function resolveReference(property:Object):ObjectResolves a property in an object definition. If the property could not be resolved, the given property is returned. This means that the property will be checked against all reference resolvers. If a reference resolver can process it, it will do so.
This method is used to resolve implementations of IObjectReference. In order to capture nested references container types like Array and Dictionary are checked as well. Parametersproperty:Object — the property that possibly that might contain references
|
Object |
See also