Packagesystem.ioc
Classpublic class ObjectConfig
InheritanceObjectConfig Inheritance Object

This object contains the configuration of the IoC object factory.

Example :

     import system.ioc.ObjectConfig ;
     
     var config:ObjectConfig = new ObjectConfig() ;
     
     config.defaultInitMethod    = "init" ;
     config.defaultDestroyMethod = "destroy" ;
     config.identify             = true ;
     
     config.typeAliases = [ { alias:"HashMap" , type:"system.data.maps.HashMap" } ] ;
     config.typePolicy  = TypePolicy.ALIAS ;
     
     trace( config ) ; // [ObjectConfig defaultDestroyMethod:destroy defaultInitMethod:init identify:true]
     



Public Properties
 PropertyDefined By
  config : Object
The config object reference used in the factory to register values and expressions.
ObjectConfig
  configEvaluator : ConfigEvaluator
[read-only] Indicates the config evaluator reference.
ObjectConfig
  defaultDestroyMethod : String
The default name of destroy callback method to invoke with object definition in the ObjectFactory.
ObjectConfig
  defaultInitMethod : String
The default name of destroy callback method to invoke with object definition in the ObjectFactory.
ObjectConfig
  identify : Boolean
Indicates if the singleton objects in the ObjectFactory are identifiy if the type of the object implements the Identifiable interface.
ObjectConfig
  lazyInit : Boolean
Indicates if the factory lock this "run" method and allow the flush of the singletons buffer who must be initialized when the process is finished.
ObjectConfig
  locale : Object
The locale object of the factory.
ObjectConfig
  localeEvaluator : LocaleEvaluator
[read-only] Indicates the locale evaluator reference.
ObjectConfig
  lock : Boolean
Indicates if all the Lockable objects initialized in the object definitions in the factory must be locked during the invokation of this methods and the initialization of this properties.
ObjectConfig
  parameters : *
The optional parameters object reference.
ObjectConfig
  referenceEvaluator : ReferenceEvaluator
[read-only] Indicates the reference evaluator object.
ObjectConfig
  root : *
The root reference of the application.
ObjectConfig
  stage : *
The stage reference of the application.
ObjectConfig
  throwError : Boolean
Indicates if the class throws errors or return null when an error is throwing.
ObjectConfig
  typeAliases : *
Determinates the typeAliases reference of this config object.
ObjectConfig
  typeEvaluator : TypeEvaluator
[read-only] Indicates the type evaluator reference.
ObjectConfig
  typeExpression : *
Determinates the content of the typeExpression reference in this config object.
ObjectConfig
  typePolicy : String
Indicates the type policy of the object factory who use this configuration object.
ObjectConfig
  useLogger : Boolean = true
Indicates if the logger model is used in the IoC factory to log the warning and errors.
ObjectConfig
Public Methods
 MethodDefined By
  
ObjectConfig(init:Object = null)
Creates a new ObjectConfig instance.
ObjectConfig
  
initialize(init:Object):void
Initialize the config object.
ObjectConfig
  
setConfigTarget(o:Object = null):void
This method is used to change the target of the internal config dynamic object.
ObjectConfig
  
setLocaleTarget(o:Object = null):void
This method is used to change the target of the internal local dynamic object.
ObjectConfig
Property Detail
configproperty
config:Object

The config object reference used in the factory to register values and expressions.


Implementation
    public function get config():Object
    public function set config(value:Object):void
configEvaluatorproperty 
configEvaluator:ConfigEvaluator  [read-only]

Indicates the config evaluator reference.


Implementation
    public function get configEvaluator():ConfigEvaluator
defaultDestroyMethodproperty 
public var defaultDestroyMethod:String

The default name of destroy callback method to invoke with object definition in the ObjectFactory.

defaultInitMethodproperty 
public var defaultInitMethod:String

The default name of destroy callback method to invoke with object definition in the ObjectFactory.

identifyproperty 
public var identify:Boolean

Indicates if the singleton objects in the ObjectFactory are identifiy if the type of the object implements the Identifiable interface.

lazyInitproperty 
public var lazyInit:Boolean

Indicates if the factory lock this "run" method and allow the flush of the singletons buffer who must be initialized when the process is finished.

localeproperty 
locale:Object

The locale object of the factory. To evaluate locale expression in the object definitions.


Implementation
    public function get locale():Object
    public function set locale(value:Object):void
localeEvaluatorproperty 
localeEvaluator:LocaleEvaluator  [read-only]

Indicates the locale evaluator reference.


Implementation
    public function get localeEvaluator():LocaleEvaluator
lockproperty 
public var lock:Boolean

Indicates if all the Lockable objects initialized in the object definitions in the factory must be locked during the invokation of this methods and the initialization of this properties.

parametersproperty 
public var parameters:*

The optional parameters object reference. This property is optional and can be target in the IoC factory with the "ref" attribute with the value "#params".

referenceEvaluatorproperty 
referenceEvaluator:ReferenceEvaluator  [read-only]

Indicates the reference evaluator object.


Implementation
    public function get referenceEvaluator():ReferenceEvaluator
rootproperty 
public var root:*

The root reference of the application. This property is optional and can be target in the IoC factory with the "ref" attribute with the value "#root".

stageproperty 
public var stage:*

The stage reference of the application. This property is optional and can be target in the IoC factory with the "ref" attribute with the value "#stage".

throwErrorproperty 
throwError:Boolean

Indicates if the class throws errors or return null when an error is throwing.


Implementation
    public function get throwError():Boolean
    public function set throwError(value:Boolean):void
typeAliasesproperty 
typeAliases:*

Determinates the typeAliases reference of this config object.

The setter of this virtual property can be populated with a TypeAliases instance or an Array of typeAliases items.

This setter attribute don't remove the old TypeAliases instance but fill it with new aliases. If you want cleanup the aliases of this configuration object you must use the typeAliases.clear() method.

The typeAliases items are generic objects with 2 attributes alias (the alias String expression) and type (the type String expression).

Example :

         import system.ioc.ObjectConfig ;
         
         var config:ObjectConfig  = new ObjectConfig() ;
         
         config.typeAliases =
         [ 
             { alias:"Sprite" , type:"flash.display.Sprite" } 
         ] ;
         


Implementation
    public function get typeAliases():*
    public function set typeAliases(value:any):void
typeEvaluatorproperty 
typeEvaluator:TypeEvaluator  [read-only]

Indicates the type evaluator reference.


Implementation
    public function get typeEvaluator():TypeEvaluator
typeExpressionproperty 
typeExpression:*

Determinates the content of the typeExpression reference in this config object.

Example 1 :

         import system.ioc.ObjectConfig ;
         import system.ioc.TypeExpression ;
         
         var exp:TypeExpression = new TypeExpression() ;
         
         exp.put( "data"    , "system.data" ) ;
         exp.put( "maps"    , "{data}.maps" ) ;
         exp.put( "HashMap" , "{maps}.HashMap" ) ;
         
         var config:ObjectConfig  = new ObjectConfig() ;
         
         config.typeExpression = exp ;
         

Example 2 : Use an Array of entries with the name/value members

         import system.ioc.ObjectConfig ;
         import system.ioc.TypeExpression ;
         
         var expressions:Array = 
         [
             { name : "data"    , value : "system.data"    } ,
             { name : "maps"    , value : "{data}.maps"    } ,
             { name : "HashMap" , value : "{maps}.HashMap" } ,
         ];
         
         var config:ObjectConfig  = new ObjectConfig() ;
         
         config.typeExpression = expressions ;
         


Implementation
    public function get typeExpression():*
    public function set typeExpression(value:any):void
typePolicyproperty 
typePolicy:String

Indicates the type policy of the object factory who use this configuration object. The default value of this attribute is TypePolicy.NONE.

You can use the TypePolicy.NONE, TypePolicy.ALL, TypePolicy.ALIAS, TypePolicy.EXPRESSION values.


Implementation
    public function get typePolicy():String
    public function set typePolicy(value:String):void

See also

useLoggerproperty 
public var useLogger:Boolean = true

Indicates if the logger model is used in the IoC factory to log the warning and errors.

Constructor Detail
ObjectConfig()Constructor
public function ObjectConfig(init:Object = null)

Creates a new ObjectConfig instance.

Parameters
init:Object (default = null) — A generic object containing properties with which to populate the newly instance. If this argument is null, it is ignored.
Method Detail
initialize()method
public function initialize(init:Object):void

Initialize the config object.

Parameters

init:Object — A generic object containing properties with which to populate the newly instance. If this argument is null, it is ignored.

setConfigTarget()method 
public function setConfigTarget(o:Object = null):void

This method is used to change the target of the internal config dynamic object.

Parameters

o:Object (default = null)

setLocaleTarget()method 
public function setLocaleTarget(o:Object = null):void

This method is used to change the target of the internal local dynamic object.

Parameters

o:Object (default = null)