Packageorg.spicefactory.lib.util
Classpublic class ClassUtil
InheritanceClassUtil Inheritance Object

Static utility methods to reflectively create new instances.



Public Methods
 MethodDefined By
  
containsDefinition(domain:ApplicationDomain, instance:Object):Boolean
[static] Checks whether the specified ApplicationDomain contains the definition for the given instance.
ClassUtil
  
createForName(className:String, params:Array):Object
[static] Creates a new instance of the class with the specified name.
ClassUtil
  
createNewInstance(type:Class, params:Array):Object
[static] Creates a new instance of the specified class.
ClassUtil
  
getSimpleName(type:Class):String
[static] Returns the unqualified short name of the specified class.
ClassUtil
Method Detail
containsDefinition()method
public static function containsDefinition(domain:ApplicationDomain, instance:Object):Boolean

Checks whether the specified ApplicationDomain contains the definition for the given instance.

Parameters

domain:ApplicationDomain — the ApplicationDomain to check
 
instance:Object — the instance to look for

Returns
Boolean — true if the specified ApplicationDomain contains the definition for the given instance
createForName()method 
public static function createForName(className:String, params:Array):Object

Creates a new instance of the class with the specified name.

Parameters

className:String — the fully qualified name of the class
 
params:Array — the parameters to pass to the constructor of the class

Returns
Object — the new instance

Throws
ReferenceError — if the class with the specified name does not exist
createNewInstance()method 
public static function createNewInstance(type:Class, params:Array):Object

Creates a new instance of the specified class.

Parameters

type:Class — the class to create a new instance of
 
params:Array — the parameters to pass to the constructor of the class

Returns
Object — the new instance
getSimpleName()method 
public static function getSimpleName(type:Class):String

Returns the unqualified short name of the specified class.

Parameters

type:Class — the class to return the unqualified short name for

Returns
String — the unqualified short name of the specified class