Packageandromeda.ioc.factory
Classpublic class ObjectConfig
InheritanceObjectConfig Inheritance CoreObject

This object contains the configuration of the IOC object factory.

Example :

     import andromeda.ioc.factory.ECMAObjectFactory ;
     import andromeda.ioc.factory.ObjectConfig ;
     
     var factory:ECMAObjectFactory = ECMAObjectFactory.getInstance() ;
     var config:ObjectConfig       = new ObjectConfig() ;
     
     config.defaultInitMethod      = "init" ;
     config.defaultDestroyMethod   = "destroy" ;
     config.identify               = true ;
     
     config.typeAliases            = [ { alias:"CoreObject" , type:"vegas.core.CoreObject" } ] ;
     config.typePolicy             = TypePolicy.ALIAS ;
     
     factory.config = config ;
     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
  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
  referenceEvaluator : ReferenceEvaluator
[read-only] Indicates the reference evaluator object.
ObjectConfig
  root : *
The root 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
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
  
initialize(init:Object):void
Initialize the config object.
ObjectConfig
  
Resets the target of the internal config dynamic object in this instance with a basic generic Object reference.
ObjectConfig
  
setConfigTarget(o:Object):void
This method is used to change the target of the internal config dynamic object.
ObjectConfig
  
setLocaleTarget(o:Object):void
This method is used to change the target of the internal local dynamic object.
ObjectConfig
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
CoreObject
  
toString():String
Returns the string representation of this instance.
ObjectConfig
Property detail
configproperty
config:Object  [read-write]

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.

localeproperty 
locale:Object  [read-write]

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.

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

throwErrorproperty 
throwError:Boolean  [read-write]

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:*  [read-write]

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 andromeda.ioc.factory.ObjectConfig ;
         var config:ObjectConfig  = new ObjectConfig() ;
         config.typeAliases       = 
         [ 
             { alias:"CoreObject" , type:"vegas.core.CoreObject" } 
         ] ;
         
Implementation
    public function get typeAliases():*
    public function set typeAliases(value:*):void
typeEvaluatorproperty 
typeEvaluator:TypeEvaluator  [read-only]

Indicates the type evaluator reference.

Implementation
    public function get typeEvaluator():TypeEvaluator
typeExpressionproperty 
typeExpression:*  [read-write]

Determinates the content of the typeExpression reference in 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 andromeda.ioc.factory.ObjectConfig ;
         var config:ObjectConfig  = new ObjectConfig() ;
         config.typeAliases       = 
         [ 
             { alias:"CoreObject" , type:"vegas.core.CoreObject" } 
         ] ;
         
Implementation
    public function get typeExpression():*
    public function set typeExpression(value:*):void
typePolicyproperty 
typePolicy:String  [read-write]

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./p> 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.
resetConfigTarget()method 
public function resetConfigTarget():void

Resets the target of the internal config dynamic object in this instance with a basic generic Object reference.

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

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

Parameters
o:Object
setLocaleTarget()method 
public function setLocaleTarget(o:Object):void

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

Parameters
o:Object
toString()method 
public override function toString():String

Returns the string representation of this instance.

Returns
String — the string representation of this instance.