Packageorg.pranaframework.ioc.factory.support
Classpublic class DefaultListableObjectFactory
InheritanceDefaultListableObjectFactory Inheritance AbstractObjectFactory Inheritance flash.events.EventDispatcher
ImplementsIConfigurableListableObjectFactory, IObjectDefinitionRegistry
SubclassesXMLObjectFactory

Default implementation of the IConfigurableListableObjectFactory and the IObjectDefinitionRegistry interfaces.



Public Properties
 PropertyDefined by
  allowObjectDefinitionOverriding : Boolean
Whether to allow re-registration of a different definition with the same name
DefaultListableObjectFactory
  numObjectDefinitions : int
[read-only] Returns the number of definitions present in the object definition registry
DefaultListableObjectFactory
 InheritednumObjectPostProcessors : int
Returns the number of object post processors.
AbstractObjectFactory
  objectDefinitionNames : Array
[read-only] Returns an array containing all object definition names.
DefaultListableObjectFactory
 InheritedtypeConverter : ITypeConverter
The current type converter implementation
AbstractObjectFactory
Protected Properties
 PropertyDefined by
 InheritedobjectDefinitions : Object
Contains the registered definitions of type IObjectDefinition.
AbstractObjectFactory
Public Methods
 MethodDefined by
  
Contructs DefaultListableObjectFactory
DefaultListableObjectFactory
 Inherited
addObjectPostProcessor(objectPostProcessor:IObjectPostProcessor):void
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
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
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 all object definitions names that implement the given type.
DefaultListableObjectFactory
  
getObjectsOfType(type:Class):Dictionary
Returns all object definitions that implement 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
  
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
Will register the given objectDefinition with the given name.
DefaultListableObjectFactory
  
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
Property detail
allowObjectDefinitionOverridingproperty
allowObjectDefinitionOverriding:Boolean  [read-write]

Whether to allow re-registration of a different definition with the same name

Implementation
    public function get allowObjectDefinitionOverriding():Boolean
    public function set allowObjectDefinitionOverriding(value:Boolean):void
numObjectDefinitionsproperty 
numObjectDefinitions:int  [read-only]

Returns the number of definitions present in the object definition registry

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

Returns an array containing all object definition names.

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

Contructs DefaultListableObjectFactory

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, or undefined if the definition has not been registered.
getObjectNamesForType()method 
public function getObjectNamesForType(type:Class):Array

Returns all object definitions names that implement the given type. To check the type, the ClassUtils.isImplementationOf method is used.

Parameters
type:Class — The type that is searched for

Returns
Array — an array containing definition names that implement the given type
getObjectsOfType()method 
public function getObjectsOfType(type:Class):Dictionary

Returns all object definitions that implement the given type. To check the type, the ClassUtils.isImplementationOf method is used.

Parameters
type:Class — The type that is searched for

Returns
Dictionary — A dictionary containing definitions that implement the given type. Definition names are used as key.
preInstantiateSingletons()method 
public function preInstantiateSingletons():void

Instantiates all definitions that are defined as singleton and are not lazy.

registerObjectDefinition()method 
public function registerObjectDefinition(objectName:String, objectDefinition:IObjectDefinition):void

Will register the given objectDefinition with the given name. If the allowObjectDefinitionOverriding has been set to true, this method will remove the existing object.

Parameters
objectName:String — The name under which the object definition should be stored
 
objectDefinition:IObjectDefinition — The object definition that should be stored
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