Packageorg.as3commons.reflect
Classpublic class ClassUtils
InheritanceClassUtils Inheritance Object
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils

Provides utilities for working with <codeph>Class</codeph> objects.



Public Methods
 MethodDefined By
  
convertFullyQualifiedName(className:String):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.convertFullyQualifiedName()
[static] Converts the double colon (::) in a fully qualified class name to a dot (.)
ClassUtils
  
forInstance(instance:*, applicationDomain:ApplicationDomain = null):Class
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.forInstance()
[static] Returns a Class object that corresponds with the given instance.
ClassUtils
  
forName(name:String, applicationDomain:ApplicationDomain = null):Class
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.forName()
[static] Returns a Class object that corresponds with the given name.
ClassUtils
  
getFullyQualifiedImplementedInterfaceNames(clazz:Class, replaceColons:Boolean = false):Array
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getFullyQualifiedImplementedInterfaceNames()
[static] Returns an array of all fully qualified interface names that the given class implements.
ClassUtils
  
getFullyQualifiedName(clazz:Class, replaceColons:Boolean = false):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getFullyQualifiedName()
[static] Returns the fully qualified name of the given class.
ClassUtils
  
getFullyQualifiedSuperClassName(clazz:Class, replaceColons:Boolean = false):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getFullyQualifiedSuperClassName()
[static] Returns the fully qualified name of the given class' superclass.
ClassUtils
  
getImplementedInterfaceNames(clazz:Class):Array
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getImplementedInterfaceNames()
[static] Returns an array of all interface names that the given class implements.
ClassUtils
  
getImplementedInterfaces(clazz:Class):Array
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getImplementedInterfaces()
[static] Returns an array of all interface names that the given class implements.
ClassUtils
  
getName(clazz:Class):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getName()
[static] Returns the name of the given class.
ClassUtils
  
getNameFromFullyQualifiedName(fullyQualifiedName:String):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getNameFromFullyQualifiedName()
[static] Returns the name of the class or interface, based on the given fully qualified class or interface name.
ClassUtils
  
getSuperClass(clazz:Class):Class
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getSuperClass()
[static] Returns the class that the passed in clazz extends.
ClassUtils
  
getSuperClassName(clazz:Class):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getSuperClassName()
[static] Returns the name of the given class' superclass.
ClassUtils
  
isAssignableFrom(clazz1:Class, clazz2:Class):Boolean
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.isAssignableFrom()
[static] Determines if the class or interface represented by the clazz1 parameter is either the same as, or is a superclass or superinterface of the clazz2 parameter.
ClassUtils
  
isImplementationOf(clazz:Class, interfaze:Class):Boolean
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.isImplementationOf()
[static] Returns whether the passed in Class object implements the given interface.
ClassUtils
  
isInterface(clazz:Class):Boolean
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.isInterface()
[static] Returns whether the passed in Class object is an interface.
ClassUtils
  
isSubclassOf(clazz:Class, parentClass:Class):Boolean
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.isSubclassOf()
[static] Returns whether the passed in Class object is a subclass of the passed in parent Class.
ClassUtils
  
newInstance(clazz:Class, args:Array = null):*
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.newInstance()
[static] Creates an instance of the given class and passes the arguments to the constructor.
ClassUtils
Method Detail
convertFullyQualifiedName()method
public static function convertFullyQualifiedName(className:String):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.convertFullyQualifiedName()

Converts the double colon (::) in a fully qualified class name to a dot (.)

Parameters

className:String

Returns
String
forInstance()method 
public static function forInstance(instance:*, applicationDomain:ApplicationDomain = null):Class
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.forInstance()

Returns a <codeph>Class</codeph> object that corresponds with the given instance. If no corresponding class was found, a <codeph>ClassNotFoundError</codeph> will be thrown.

Parameters

instance:* — the instance from which to return the class
 
applicationDomain:ApplicationDomain (default = null) — the optional applicationdomain where the instance's class resides

Returns
Class — the <codeph>Class</codeph> that corresponds with the given instance
forName()method 
public static function forName(name:String, applicationDomain:ApplicationDomain = null):Class
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.forName()

Returns a <codeph>Class</codeph> object that corresponds with the given name. If no correspoding class was found in the applicationdomain tree, a <codeph>ClassNotFoundError</codeph> will be thrown.

Parameters

name:String — the name from which to return the class
 
applicationDomain:ApplicationDomain (default = null) — the optional applicationdomain where the instance's class resides

Returns
Class — the <codeph>Class</codeph> that corresponds with the given name

See also

org.springextensions.actionscript.errors.ClassNotFoundError
getFullyQualifiedImplementedInterfaceNames()method 
public static function getFullyQualifiedImplementedInterfaceNames(clazz:Class, replaceColons:Boolean = false):Array
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getFullyQualifiedImplementedInterfaceNames()

Returns an array of all fully qualified interface names that the given class implements.

Parameters

clazz:Class
 
replaceColons:Boolean (default = false)

Returns
Array
getFullyQualifiedName()method 
public static function getFullyQualifiedName(clazz:Class, replaceColons:Boolean = false):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getFullyQualifiedName()

Returns the fully qualified name of the given class.

Parameters

clazz:Class — the class to get the name from
 
replaceColons:Boolean (default = false) — whether the double colons "::" should be replaced by a dot "." the default is false

Returns
String — the fully qualified name of the class
getFullyQualifiedSuperClassName()method 
public static function getFullyQualifiedSuperClassName(clazz:Class, replaceColons:Boolean = false):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getFullyQualifiedSuperClassName()

Returns the fully qualified name of the given class' superclass.

Parameters

clazz:Class — the class to get its superclass' name from
 
replaceColons:Boolean (default = false) — whether the double colons "::" should be replaced by a dot "." the default is false

Returns
String — the fully qualified name of the class' superclass
getImplementedInterfaceNames()method 
public static function getImplementedInterfaceNames(clazz:Class):Array
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getImplementedInterfaceNames()

Returns an array of all interface names that the given class implements.

Parameters

clazz:Class

Returns
Array
getImplementedInterfaces()method 
public static function getImplementedInterfaces(clazz:Class):Array
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getImplementedInterfaces()

Returns an array of all interface names that the given class implements.

Parameters

clazz:Class

Returns
Array
getName()method 
public static function getName(clazz:Class):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getName()

Returns the name of the given class.

Parameters

clazz:Class — the class to get the name from

Returns
String — the name of the class
getNameFromFullyQualifiedName()method 
public static function getNameFromFullyQualifiedName(fullyQualifiedName:String):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getNameFromFullyQualifiedName()

Returns the name of the class or interface, based on the given fully qualified class or interface name.

Parameters

fullyQualifiedName:String — the fully qualified name of the class or interface

Returns
String — the name of the class or interface
getSuperClass()method 
public static function getSuperClass(clazz:Class):Class
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getSuperClass()

Returns the class that the passed in clazz extends. If no super class was found, in case of Object, null is returned.

Parameters

clazz:Class — the class to get the super class from

Returns
Class
getSuperClassName()method 
public static function getSuperClassName(clazz:Class):String
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.getSuperClassName()

Returns the name of the given class' superclass.

Parameters

clazz:Class — the class to get the name of its superclass' from

Returns
String — the name of the class' superclass
isAssignableFrom()method 
public static function isAssignableFrom(clazz1:Class, clazz2:Class):Boolean
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.isAssignableFrom()

Determines if the class or interface represented by the clazz1 parameter is either the same as, or is a superclass or superinterface of the clazz2 parameter. It returns true if so; otherwise it returns false.

Parameters

clazz1:Class
 
clazz2:Class

Returns
Boolean — the boolean value indicating whether objects of the type clazz2 can be assigned to objects of clazz1
isImplementationOf()method 
public static function isImplementationOf(clazz:Class, interfaze:Class):Boolean
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.isImplementationOf()

Returns whether the passed in <codeph>Class</codeph> object implements the given interface.

Parameters

clazz:Class — the class to check for an implemented interface
 
interfaze:Class — the interface that the clazz argument should implement

Returns
Boolean — true if the clazz object implements the given interface; false if not
isInterface()method 
public static function isInterface(clazz:Class):Boolean
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.isInterface()

Returns whether the passed in Class object is an interface.

Parameters

clazz:Class — the class to check

Returns
Boolean — true if the clazz is an interface; false if not
isSubclassOf()method 
public static function isSubclassOf(clazz:Class, parentClass:Class):Boolean
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.isSubclassOf()

Returns whether the passed in Class object is a subclass of the passed in parent Class. To check if an interface extends another interface, use the isImplementationOf() method instead.

Parameters

clazz:Class
 
parentClass:Class

Returns
Boolean
newInstance()method 
public static function newInstance(clazz:Class, args:Array = null):*
Deprecated Since 1.1: Please Use org.as3commons.lang.ClassUtils.newInstance()

Creates an instance of the given class and passes the arguments to the constructor. TODO find a generic solution for this. Currently we support constructors with a maximum of 10 arguments.

Parameters

clazz:Class — the class from which an instance will be created
 
args:Array (default = null) — the arguments that need to be passed to the constructor

Returns
*