Packageorg.springextensions.actionscript.ioc.factory.support
SVN browsingDefaultListableObjectFactory.as
FisheyeDefaultListableObjectFactory.as
Classpublic class DefaultListableObjectFactory
InheritanceDefaultListableObjectFactory Inheritance AbstractObjectFactory Inheritance flash.events.EventDispatcher
ImplementsIConfigurableListableObjectFactory, IObjectDefinitionRegistry
SubclassesAbstractApplicationContext

Default implementation of the IConfigurableListableObjectFactory and the IObjectDefinitionRegistry interfaces.



Documentation reference: instantiating a container


Public Properties
 PropertyDefined by
  allowObjectDefinitionOverriding : Boolean
[write-only] Set whether it should be allowed to override object definitions by registering a different definition with the same name, automatically replacing the former.
DefaultListableObjectFactory
 InheritedapplicationDomain : ApplicationDomain
AbstractObjectFactory
 InheritedautowireProcessor : IAutowireProcessor
AbstractObjectFactory
 InheritedexplicitSingletonNames : Array
The names of the explicit singletons registered in this factory.
AbstractObjectFactory
  numObjectDefinitions : uint
[read-only] The number of object definitions in this registry.
DefaultListableObjectFactory
 InheritednumObjectPostProcessors : int
Returns the number of object post processors.
AbstractObjectFactory
  objectDefinitionNames : Array
[read-only] The names of the registered object definitions.
DefaultListableObjectFactory
 InheritedobjectDefinitions : Object
AbstractObjectFactory
 Inheritedparent : IObjectFactory
AbstractObjectFactory
 Inheritedproperties : Properties
AbstractObjectFactory
 InheritedtypeConverter : ITypeConverter
The current type converter implementation
AbstractObjectFactory
Protected Properties
 PropertyDefined by
 InheritedearlySingletonCache : Object
Cache of early cached singletons for circular references
AbstractObjectFactory
 InheritedexplicitSingletonCache : Object
Cache of singleton objects registered without object definition
AbstractObjectFactory
 InheritedobjectPostProcessors : Array
Object post processors to apply when creating objects
AbstractObjectFactory
 InheritedreferenceResolvers : Array
Reference resolvers used when creating objects
AbstractObjectFactory
 InheritedsingletonCache : Object
Cache of created singleton objects via an object definition
AbstractObjectFactory
Public Methods
 MethodDefined by
  
Constructs a new DefaultListableObjectFactory instance.
DefaultListableObjectFactory
 Inherited
addObjectPostProcessor(objectPostProcessor:IObjectPostProcessor):void

If the specified IObjectPostProcessor implements IApplicationDomainAware the current AbstractObjectFactory.applicationDomain will be injected.

Adds an object postprocessor to this object factory.
AbstractObjectFactory
 Inherited
addReferenceResolver(referenceResolver:IReferenceResolver):void
This method adds a reference resolver that will be used to resolve property references.
AbstractObjectFactory
 Inherited
canCreate(objectName:String):Boolean
Determines if the object factory is able to create the object with the given name.
AbstractObjectFactory
 Inherited
clearObjectFromInternalCache(name:String):Object
Removes an object from the internal object definition cache.
AbstractObjectFactory
 Inherited
containsObject(objectName:String):Boolean
Determines if the object factory contains a definition with the given name.
AbstractObjectFactory
  
containsObjectDefinition(objectName:String):Boolean
Determines if an object definition with the given name exists
DefaultListableObjectFactory
 Inherited
createInstance(clazz:Class, constructorArguments:Array = null):*
Creates an instance of the specified Class, wires the instance and returns it.
AbstractObjectFactory
 Inherited
getClassForInstance(object:Object):Class
AbstractObjectFactory
 Inherited
getClassForName(className:String):Class
AbstractObjectFactory
 Inherited
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.
AbstractObjectFactory
  
Returns the object definition registered with the given name.
DefaultListableObjectFactory
  
getObjectNamesForType(type:Class):Array
Returns the names of all object definitions and explicit singletons in this factory that are of the given type.
DefaultListableObjectFactory
  
getObjectsOfType(type:Class):Object
Returns all object definitions and explicit singletons that are of the given type.
DefaultListableObjectFactory
 Inherited
getType(objectName:String):Class
Returns the type that is defined on the object definition.
AbstractObjectFactory
 Inherited
isFactoryObject(objectName:String):Boolean
Determines if an object is a IFactoryObject implementation.
AbstractObjectFactory
 Inherited
isPrototype(objectName:String):Boolean
Determines if the definition with the given name is a prototype.
AbstractObjectFactory
 Inherited
isSingleton(objectName:String):Boolean
Determines if the definition with the given name is a singleton.
AbstractObjectFactory
  

Checks if the objectdefinition is an implementation of IFactoryObject, if so the factory will be pre-instantiated, not the result of the factory.

Instantiates all definitions that are defined as singleton and are not lazy.
DefaultListableObjectFactory
 Inherited
registerCustomEditor(requiredType:Class, propertyEditor:IPropertyEditor):void
Registers a custom property editor.
AbstractObjectFactory
  
registerObjectDefinition(objectName:String, objectDefinition:IObjectDefinition):void
Registers the given objectDefinition under the given name.
DefaultListableObjectFactory
 Inherited
registerSingleton(name:String, object:Object):void
Registers a singleton object in the factory.
AbstractObjectFactory
  
removeObjectDefinition(objectName:String):void
Removes the definition with the given name from the registry
DefaultListableObjectFactory
 Inherited
resolveReference(property:Object):Object
Resolves a property in an object definition.
AbstractObjectFactory
 Inherited
wire(object:*, objectDefinition:IObjectDefinition, objectName:String = null):void
AbstractObjectFactory
Protected Methods
 MethodDefined by
 Inherited
buildObject(name:String, constructorArguments:Array = null):*
Builds an object for the given name and returns it.
AbstractObjectFactory
 Inherited
createObjectViaInstanceFactoryMethod(objectName:String, methodName:String, args:Array = null):*
AbstractObjectFactory
 Inherited
createObjectViaStaticFactoryMethod(clazz:Class, applicationDomain:ApplicationDomain, factoryMethodName:String, args:Array = null):*
AbstractObjectFactory
Public Constants
 ConstantDefined by
 InheritedOBJECT_FACTORY_PREFIX : String = "&"
[static] Used to dereference an IFactoryObject instance and distinguish it from objects created by the IFactoryObject.
AbstractObjectFactory
 InheritedTHIS : String = "this"
[static]
AbstractObjectFactory
Property detail
allowObjectDefinitionOverridingproperty
allowObjectDefinitionOverriding:Boolean  [write-only]

Set whether it should be allowed to override object definitions by registering a different definition with the same name, automatically replacing the former. If not, an error will be thrown.

The default value is true.

Implementation
    public function set allowObjectDefinitionOverriding(value:Boolean):void

See also

numObjectDefinitionsproperty 
numObjectDefinitions:uint  [read-only]

The number of object definitions in this registry.

Implementation
    public function get numObjectDefinitions():uint
objectDefinitionNamesproperty 
objectDefinitionNames:Array  [read-only]

The names of the registered object definitions.

Implementation
    public function get objectDefinitionNames():Array
Constructor detail
DefaultListableObjectFactory()constructor
public function DefaultListableObjectFactory()

Constructs a new DefaultListableObjectFactory instance.

Method detail
containsObjectDefinition()method
public function containsObjectDefinition(objectName:String):Boolean

Determines if an object definition with the given name exists

Parameters
objectName:String — The name/id of the object definition

Returns
Boolean
getObjectDefinition()method 
public function getObjectDefinition(objectName:String):IObjectDefinition

Returns the object definition registered with the given name. If the object definition does not exist undefined will be returned.

Parameters
objectName:String — the name/id of the definition to retrieve

Returns
IObjectDefinition — the registered object definition
getObjectNamesForType()method 
public function getObjectNamesForType(type:Class):Array

Returns the names of all object definitions and explicit singletons in this factory that are of the given type.

Parameters
type:Class — The type that is searched for

Returns
Array — an array containing definition names that implement the given type

Throws
— if the class for the specified ObjectDefinition isn't found
getObjectsOfType()method 
public function getObjectsOfType(type:Class):Object

Returns all object definitions and explicit singletons that are of the given type.

Parameters
type:Class — the type that is searched for

Returns
Object — An object (hashmap) containing definitions that implement the given type. Definition names are used as key.
preInstantiateSingletons()method 
public function preInstantiateSingletons():void

Checks if the objectdefinition is an implementation of IFactoryObject, if so the factory will be pre-instantiated, not the result of the factory.

Instantiates all definitions that are defined as singleton and are not lazy.
registerObjectDefinition()method 
public function registerObjectDefinition(objectName:String, objectDefinition:IObjectDefinition):void

Registers the given objectDefinition under the given name.

Parameters
objectName:String — the name under which the object definition should be stored
 
objectDefinition:IObjectDefinition — the object definition to store
removeObjectDefinition()method 
public function removeObjectDefinition(objectName:String):void

Removes the definition with the given name from the registry

Parameters
objectName:String — The name/id of the definition to remove