Packageandromeda.ioc.core
Classpublic class TypeAliases
InheritanceTypeAliases Inheritance CoreObject

This object is an helper who contains type aliases.

This helper is used in a ioc container (ObjectFactory) to map the type class of an object.

Example :

     import andromeda.ioc.core.TypeAliases ;
     import system.data.Iterator ;
     
     var aliases:TypeAliases = new TypeAliases() ;
     
     aliases.put( "DropShadowFilter" , "flash.filters.DropShadowFilter" ) ;
     aliases.put( "CoreObject"       , "vegas.core.CoreObject" ) ;
     aliases.put( "ObjectFactory"    , "andromeda.factory.ObjectFactory" ) ;
     aliases.put( "vegas.HashMap"    , "system.data.maps.HashMap" ) ; // can use custom alias
     
     trace("-------- aliases.containsAlias('DropShadowFilter')") ;
     
     trace( aliases.containsAlias('DropShadowFilter') ) ;
     trace( aliases.containsAlias('noAlias') ) ;
     
     trace("-------- aliases.containsValue()") ;
     
     trace( aliases.containsValue('vegas.core.CoreObject') ) ;
     trace( aliases.containsAlias('noValue') ) ;
     
     trace("-------- aliases.getAliases()") ;
     
     trace( aliases.getAliases() ) ;
     
     trace("-------- aliases.getValue('CoreObject')") ;
     
     trace( aliases.getValue("CoreObject") ) ;
     
     trace("-------- aliases.getValues()") ;
     
     trace( aliases.getValues() ) ;
     
     trace("-------- iterator") ;
     
     var it:Iterator = aliases.iterator() ;
     while( it.hasNext() )
     {
         var next:String = it.next() as String ;
         var key:String  = it.key()  as String ;
         trace( aliases + " alias : '" + key + "' -> value : '" + next + "'" ) ;
     }
     
     trace("-------- clear and isEmpty") ;
     
     trace( aliases.isEmpty() ) ;
     aliases.clear() ;
     trace( aliases.isEmpty() ) ;
     



Public Methods
 MethodDefined by
  
Creates a new TypeAliases instance.
TypeAliases
  
clear():void
Clear all alias in the internal map of this object.
TypeAliases
  
containsAlias(alias:String):Boolean
Indicates if the collector contains the passed-in alias expression.
TypeAliases
  
containsValue(value:String):Boolean
Indicates if the collector contains the passed-in type value expression.
TypeAliases
  
getAliases():Array
Returns the Array representation of all aliases registered in this collector.
TypeAliases
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
  
Returns the internal Map reference of this collector.
TypeAliases
  
getValue(alias:String):String
Returns the value of the specified alias.
TypeAliases
  
getValues():Array
Returns the Array representation of all type values registered in this collector.
TypeAliases
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
  
isEmpty():Boolean
Returns true if the collector is empty.
TypeAliases
  
Returns the Iterator of the object.
TypeAliases
  
put(alias:String, value:String):Boolean
Inserts an alias in the collector.
TypeAliases
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreObject
  
size():uint
Returns the number of alias registered in the collector.
TypeAliases
 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
Constructor detail
TypeAliases()constructor
public function TypeAliases()

Creates a new TypeAliases instance.

Method detail
clear()method
public function clear():void

Clear all alias in the internal map of this object.

containsAlias()method 
public function containsAlias(alias:String):Boolean

Indicates if the collector contains the passed-in alias expression.

Parameters
alias:String

Returns
Booleantrue if the collector contains the passed-in alias expression.
containsValue()method 
public function containsValue(value:String):Boolean

Indicates if the collector contains the passed-in type value expression.

Parameters
value:String

Returns
Booleantrue if the collector contains the passed-in type value expression.
getAliases()method 
public function getAliases():Array

Returns the Array representation of all aliases registered in this collector.

         import andromeda.ioc.core.TypeAliases ;
         
         var aliases:TypeAliases = new TypeAliases() ;
         
         aliases.put( "DropShadowFilter" , "flash.filters.DropShadowFilter" ) ;
         aliases.put( "CoreObject"       , "vegas.core.CoreObject" ) ;
         
         trace( aliases.getAliases() ) ; // DropShadowFilter,CoreObject
         

Returns
Array — the Array representation of all aliases registered in this collector.
getMap()method 
public function getMap():Map

Returns the internal Map reference of this collector.

Returns
Map — the internal Map reference of this collector.
getValue()method 
public function getValue(alias:String):String

Returns the value of the specified alias.

Example :

         import andromeda.ioc.core.TypeAliases ;
         
         var aliases:TypeAliases = new TypeAliases() ;
         aliases.put( "CoreObject" , "vegas.core.CoreObject" ) ;
         
         trace( aliases.getValue("CoreObject") ) ; // vegas.core.CoreObject
         
Parameters
alias:String

Returns
String — the value of the specified alias.
getValues()method 
public function getValues():Array

Returns the Array representation of all type values registered in this collector.

Example :

         import andromeda.ioc.core.TypeAliases ;
         
         var aliases:TypeAliases = new TypeAliases() ;
         aliases.put( "DropShadowFilter" , "flash.filters.DropShadowFilter" ) ;
         aliases.put( "CoreObject"       , "vegas.core.CoreObject" ) ;
         
         trace( aliases.getValues() ) ; // flash.filters.DropShadowFilter,vegas.core.CoreObject
         

Returns
Array — the Array representation of all type values registered in this collector.
isEmpty()method 
public function isEmpty():Boolean

Returns true if the collector is empty.

Returns
Booleantrue if the collector is empty.
iterator()method 
public function iterator():Iterator

Returns the Iterator of the object.

Example :

         import andromeda.ioc.core.TypeAliases ;
         import system.data.Iterator ;
         
         var aliases:TypeAliases = new TypeAliases() ;
         
         aliases.put( "DropShadowFilter" , "flash.filters.DropShadowFilter" ) ;
         aliases.put( "CoreObject"       , "vegas.core.CoreObject" ) ;
         aliases.put( "ObjectFactory"    , "andromeda.factory.ObjectFactory" ) ;
         aliases.put( "vegas.HashMap"    , "system.data.maps.HashMap" ) ; // can use custom alias
         
         var it:Iterator = aliases.iterator() ;
         while( it.hasNext() )
         {
             var next:String = it.next() as String ;
             var key:String  = it.key()  as String ;
             trace( aliases + " alias : '" + key + "' -> value : '" + next + "'" ) ;
         }
         

Returns
Iterator — the Iterator of the object.
put()method 
public function put(alias:String, value:String):Boolean

Inserts an alias in the collector. If the alias already exist the value in the collector is replaced.

Example

         import andromeda.ioc.core.TypeAliases ;
         
         var aliases:TypeAliases = new TypeAliases() ;
         
         aliases.put( "DropShadowFilter" , "flash.filters.DropShadowFilter" ) ;
         aliases.put( "CoreObject"       , "vegas.core.CoreObject" ) ;
         aliases.put( "ObjectFactory"    , "andromeda.factory.ObjectFactory" ) ;
         aliases.put( "vegas.HashMap"    , "system.data.maps.HashMap" ) ; // can use custom alias
         
Parameters
alias: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.
size()method 
public function size():uint

Returns the number of alias registered in the collector.

Returns
uint — the number of alias registered in the collector.