| Package | system.ioc |
| Class | public class ObjectConfig |
| Inheritance | ObjectConfig Object |
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]
| Property | Defined 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 | ||
| Method | Defined 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 | ||
| config | property |
config:ObjectThe config object reference used in the factory to register values and expressions.
public function get config():Object public function set config(value:Object):void| configEvaluator | property |
configEvaluator:ConfigEvaluator [read-only] Indicates the config evaluator reference.
public function get configEvaluator():ConfigEvaluator| defaultDestroyMethod | property |
public var defaultDestroyMethod:StringThe default name of destroy callback method to invoke with object definition in the ObjectFactory.
| defaultInitMethod | property |
public var defaultInitMethod:StringThe default name of destroy callback method to invoke with object definition in the ObjectFactory.
| identify | property |
public var identify:BooleanIndicates if the singleton objects in the ObjectFactory are identifiy if the type of the object implements the Identifiable interface.
| lazyInit | property |
public var lazyInit:BooleanIndicates if the factory lock this "run" method and allow the flush of the singletons buffer who must be initialized when the process is finished.
| locale | property |
locale:ObjectThe locale object of the factory. To evaluate locale expression in the object definitions.
public function get locale():Object public function set locale(value:Object):void| localeEvaluator | property |
localeEvaluator:LocaleEvaluator [read-only] Indicates the locale evaluator reference.
public function get localeEvaluator():LocaleEvaluator| lock | property |
public var lock:BooleanIndicates 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.
| parameters | property |
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".
| referenceEvaluator | property |
referenceEvaluator:ReferenceEvaluator [read-only] Indicates the reference evaluator object.
public function get referenceEvaluator():ReferenceEvaluator| root | property |
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".
| stage | property |
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".
| throwError | property |
throwError:BooleanIndicates if the class throws errors or return null when an error is throwing.
public function get throwError():Boolean public function set throwError(value:Boolean):void| typeAliases | property |
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" }
] ;
public function get typeAliases():* public function set typeAliases(value:any):void| typeEvaluator | property |
typeEvaluator:TypeEvaluator [read-only] Indicates the type evaluator reference.
public function get typeEvaluator():TypeEvaluator| typeExpression | property |
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 ;
public function get typeExpression():* public function set typeExpression(value:any):void| typePolicy | property |
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.
public function get typePolicy():String public function set typePolicy(value:String):voidSee also
| useLogger | property |
public var useLogger:Boolean = trueIndicates if the logger model is used in the IoC factory to log the warning and errors.
| ObjectConfig | () | Constructor |
public function ObjectConfig(init:Object = null)Creates a new ObjectConfig instance.
Parametersinit:Object (default = null) — A generic object containing properties with which to populate the newly instance. If this argument is null, it is ignored.
|
| initialize | () | method |
public function initialize(init:Object):voidInitialize 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):voidThis 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):voidThis method is used to change the target of the internal local dynamic object.
Parameters
o:Object (default = null) |