Packageandromeda.ioc.evaluators
Classpublic class TypeEvaluator
InheritanceTypeEvaluator Inheritance CoreObject
ImplementsEvaluable

Evaluates a type string expression and return the type Class who corresponding in the application.

Example :

     import andromeda.ioc.core.TypePolicy ;
     import andromeda.ioc.evaluators.TypeEvaluator ;
     import andromeda.ioc.factory.ObjectConfig ;
     
     var conf:ObjectConfig = new ObjectConfig() ;
     
     conf.typePolicy       = TypePolicy.ALL ; // TypePolicy.NONE, TypePolicy.ALIAS, TypePolicy.EXPRESSION
     conf.typeAliases      =
     [
         { alias:"CoreObject" , type:"vegas.core.CoreObject" }
     ] ;
     
     conf.typeExpression   =
     [
         { name:"map"     , value:"system.data.maps" } ,
         { name:"HashMap" , value:"{map}.HashMap"  }
     ] ;
     
     var evaluator:TypeEvaluator = new TypeEvaluator( conf ) ;
     
     trace( evaluator.eval( "CoreObject"  ) ) ; // [class CoreObject]
     trace( evaluator.eval( "{HashMap}"   ) ) ; // [class HashMap]
     trace( evaluator.eval( "test"        ) ) ; // null
     trace( evaluator.eval( "{map}.Test"  ) ) ; // null
     



Public Properties
 PropertyDefined by
  config : ObjectConfig
The ObjectConfig reference of this evaluator.
TypeEvaluator
  throwError : Boolean
Indicates if the eval() method throws errors or return null when an error is throwing.
TypeEvaluator
Public Methods
 MethodDefined by
  
TypeEvaluator(config:ObjectConfig = null)
Creates a new TypeEvaluator instance.
TypeEvaluator
  
eval(o:*):*
Evaluates the specified object.
TypeEvaluator
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
 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
 Inherited
toString():String
Returns the string representation of this instance.
CoreObject
Property detail
configproperty
public var config:ObjectConfig

The ObjectConfig reference of this evaluator.

throwErrorproperty 
public var throwError:Boolean

Indicates if the eval() method throws errors or return null when an error is throwing.

Constructor detail
TypeEvaluator()constructor
public function TypeEvaluator(config:ObjectConfig = null)

Creates a new TypeEvaluator instance.

Parameters
config:ObjectConfig (default = null) — The optional ObjectConfig object to filter the type expression to evaluate.
Method detail
eval()method
public function eval(o:*):*

Evaluates the specified object.

Parameters
o:*

Returns
*