Packagesystem.ioc.evaluators
Classpublic class TypeEvaluator
InheritanceTypeEvaluator Inheritance Object
Implements Evaluable

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

Example :

     import system.ioc.evaluators.TypeEvaluator ;
     import system.ioc.ObjectConfig ;
     import system.ioc.TypePolicy ;
     
     var conf:ObjectConfig = new ObjectConfig() ;
     
     conf.typePolicy       = TypePolicy.ALL ; // TypePolicy.NONE, TypePolicy.ALIAS, TypePolicy.EXPRESSION
     conf.typeAliases      =
     [
         { alias:"MovieClip" , type:"flash.display.MovieClip" }
     ] ;
     
     conf.typeExpression   =
     [
         { name:"map"     , value:"system.data.maps" } ,
         { name:"HashMap" , value:"{map}.HashMap"  }
     ] ;
     
     var evaluator:TypeEvaluator = new TypeEvaluator( conf ) ;
     
     trace( evaluator.eval( "MovieClip"   ) ) ; // [class MovieClip]
     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
  
Creates a new TypeEvaluator instance.
TypeEvaluator
  
eval(o:*):*
Evaluates the specified object.
TypeEvaluator
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
*