Class: ObjectConfig

system.ioc. ObjectConfig


new ObjectConfig(init)

This object contains the configuration of the IoC factory.

Parameters:
Name Type Description
init Object

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

Members


<static> config :Object

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

Type:
  • Object

<static, readonly> configEvaluator :system.ioc.evaluators.ConfigEvaluator

Returns the config evaluator reference.

Type:
  • system.ioc.evaluators.ConfigEvaluator

<static> defaultDestroyMethod :string

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

Type:
  • string

<static> defaultInitMethod :string

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

Type:
  • string

<static> domain :Object

The optional domain used in the factory to creates the objects (by default use core.global if this property is not defined).

Type:
  • Object

<static> identifiy :boolean

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

Type:
  • boolean
Default Value:
  • false

<static> 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.

Type:
  • boolean
Default Value:
  • false

<static, readonly> locale :system.ioc.evaluators.LocaleEvaluator

Returns the local evaluator reference.

Type:
  • system.ioc.evaluators.LocaleEvaluator

<static> locale :Object

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

Type:
  • Object

<static> lock :boolean

Indicates if all the system.process.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.

Type:
  • boolean
Default Value:
  • false

<static> 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".


<static, readonly> referenceEvaluator :system.ioc.evaluators.ReferenceEvaluator

Indicates the reference evaluator object.

Type:

<static> 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".


<static> 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".


<static> throwError :boolean

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

Type:
  • boolean

<static, constant> TYPE_ALIAS :string

Defines the attribute name of the alias expression in a typeAlias object in the configuration of the ioc factory.

Type:
  • string
Default Value:
  • alias

<static> 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
var ObjectConfig = system.ioc.ObjectConfig ;

var config  = new ObjectConfig() ;

config.typeAliases =
[
    { alias : "Sprite" , type : "flash.display.Sprite" }
] ;

<static, readonly> typeEvaluator :system.ioc.evaluators.TypeEvaluator

Indicates the type evaluator reference.

Type:

<static> typeExpression

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

Examples

Example 1 : basic usage

var ObjectConfig = system.ioc.ObjectConfig ;
var ExpressionFormatter = system.formatters.ExpressionFormatter ;

var exp = new ExpressionFormatter() ;

exp.set( "data"    , "system.data" ) ;
exp.set( "maps"    , "{data}.maps" ) ;
exp.set( "HashMap" , "{maps}.HashMap" ) ;

var config  = new ObjectConfig() ;

config.typeExpression = exp ;

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

var ObjectConfig = system.ioc.ObjectConfig ;

var expressions =
[
    { name : "data"    , value : "system.data"    } ,
    { name : "maps"    , value : "{data}.maps"    } ,
    { name : "HashMap" , value : "{maps}.HashMap" }
];

var config = new ObjectConfig() ;

config.typeExpression = expressions ;

<static> typePolicy

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.

See:

<static> useLogger :boolean

Indicates if a Logger is used in the IoC factory to log the warning and errors.

Type:
  • boolean
Default Value:
  • false

Methods


initialize(init)

Initialize the config object.

Parameters:
Name Type Description
init Object

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


setConfigTarget(o)

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

Parameters:
Name Type Description
o object

The object to target the configuration object of the factory.


setLocaleTarget(o)

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

Parameters:
Name Type Description
o object

The object to target the i18n object of the factory.


toString()

Returns the String representation of the object.

Returns:

the String representation of the object.