Packagesystem.ioc
Classpublic dynamic class TypeExpression
InheritanceTypeExpression Inheritance ExpressionFormatter Inheritance flash.utils.Dictionary

This object is an helper who contains type expressions and can format a type with all expression registered in the dictionnary.

Example :

     import system.ioc.TypeExpression ;
     
     var exp:TypeExpression = new TypeExpression() ;
     
     exp.put( "package"            , "foo.bar.myPackage" ) ;
     exp.put( "package.controller" , "{package}.controller" ) ;
     
     var type:String = "{package.controller}.InitApplication" ;
     
     var result:String = exp.format(type) ;
     
     trace( "type:" + type + ", result:" + result ) ;
     



Public Properties
 PropertyDefined By
 InheritedbeginSeparator : String
The begin separator of the expression to format (default "{").
ExpressionFormatter
 InheritedendSeparator : String
The end separator of the expression to format (default "}").
ExpressionFormatter
 InheritedMAX_RECURSION : uint = 200
[static] The max recursion value.
ExpressionFormatter
Public Methods
 MethodDefined By
  
TypeExpression(weakKeys:Boolean = false)
Creates a new TypeExpression instance.
TypeExpression
 Inherited
format(value:* = null):String
Formats the specified value.
ExpressionFormatter
  
put(key:String, value:String):Boolean
Inserts a new expression in the collector.
TypeExpression
Constructor Detail
TypeExpression()Constructor
public function TypeExpression(weakKeys:Boolean = false)

Creates a new TypeExpression instance.

Parameters
weakKeys:Boolean (default = false) — Instructs the Dictionary object to use "weak" references on object keys. If the only reference to an object is in the specified Dictionary object, the key is eligible for garbage collection and is removed from the table when the object is collected.
Method Detail
put()method
public function put(key:String, value:String):Boolean

Inserts a new expression in the collector. If the expression already exist, the value in the collector is replaced.

Parameters

key:String — The alias name, this expression not must be null and not empty or the method return false.
 
value:String — The value of the alias type, this expression not must be null and not empty or the method return false.

Returns
Booleantrue if the alias can be registered.