Packageorg.as3utils
Classpublic final class ReflectionUtil
InheritanceReflectionUtil Inheritance Object

Provides a very basic reflection API.

This is a static class and shouldn't be instantiated.

View the examples



Public Methods
 MethodDefined By
  
Reflection is a static class and shouldn't be instantiated.
ReflectionUtil
  
classNameEquals(o1:*, o2:*):Boolean
[static] Performs the comparison between the two arguments using the getClassName() method.
ReflectionUtil
  
classPackageEquals(o1:*, o2:*):Boolean
[static] Performs the comparison between the two arguments using the getClassPackage() method.
ReflectionUtil
  
classPathEquals(o1:*, o2:*):Boolean
[static] Performs the comparison between the two arguments using the getClassPath() method.
ReflectionUtil
  
getClassName(o:*):String
[static] Retrieves the class name of the target instance or type (Class).
ReflectionUtil
  
getClassPackage(o:*):String
[static] Retrieves the class package of the target instance or type (Class).
ReflectionUtil
  
getClassPath(o:*):String
[static] Retrieves the full qualified class name of the target instance or type (Class).
ReflectionUtil
  
getSuperClassName(o:*):String
[static] Retrieves the super class name of the target instance or type (Class).
ReflectionUtil
  
[static] Retrieves the super class package of the target instance or type (Class).
ReflectionUtil
  
getSuperClassPath(o:*):String
[static] Retrieves the full qualified class name of the super class of the target instance or type (Class).
ReflectionUtil
  
superClassNameEquals(o1:*, o2:*):Boolean
[static] Performs the comparison between the two arguments using the getSuperClassName() method.
ReflectionUtil
  
superClassPackageEquals(o1:*, o2:*):Boolean
[static] Performs the comparison between the two arguments using the getSuperClassPackage() method.
ReflectionUtil
  
superClassPathEquals(o1:*, o2:*):Boolean
[static] Performs the comparison between the two arguments using the getSuperClassPath() method.
ReflectionUtil
Constructor Detail
ReflectionUtil()Constructor
public function ReflectionUtil()

Reflection is a static class and shouldn't be instantiated.


Throws
IllegalOperationError — Reflection is a static class and shouldn't be instantiated.
Method Detail
classNameEquals()method
public static function classNameEquals(o1:*, o2:*):Boolean

Performs the comparison between the two arguments using the getClassName() method.

Parameters

o1:* — The first instance or type (Class) to be compared.
 
o2:* — The second instance or type (Class) to be compared.

Returns
BooleanTrue if the class names are equal.
classPackageEquals()method 
public static function classPackageEquals(o1:*, o2:*):Boolean

Performs the comparison between the two arguments using the getClassPackage() method.

Parameters

o1:* — The first instance or type (Class) to be compared.
 
o2:* — The second instance or type (Class) to be compared.

Returns
BooleanTrue if the class packages are equal.
classPathEquals()method 
public static function classPathEquals(o1:*, o2:*):Boolean

Performs the comparison between the two arguments using the getClassPath() method.

Parameters

o1:* — The first instance or type (Class) to be compared.
 
o2:* — The second instance or type (Class) to be compared.

Returns
BooleanTrue if the class path are equal.
getClassName()method 
public static function getClassName(o:*):String

Retrieves the class name of the target instance or type (Class).

Parameters

o:* — The target instance or type (Class).

Returns
String — The class name of the target instance or type (Class).
getClassPackage()method 
public static function getClassPackage(o:*):String

Retrieves the class package of the target instance or type (Class).

Parameters

o:* — The target instance or type (Class).

Returns
String — The package string representation of the target instance or type (Class).
getClassPath()method 
public static function getClassPath(o:*):String

Retrieves the full qualified class name of the target instance or type (Class).

Parameters

o:* — The target instance or type (Class).

Returns
String — The full qualified class name string representation (package + name) of the target instance or type (Class).
getSuperClassName()method 
public static function getSuperClassName(o:*):String

Retrieves the super class name of the target instance or type (Class).

Parameters

o:* — The target instance or type (Class).

Returns
String — The super class name of the target instance or type (Class).
getSuperClassPackage()method 
public static function getSuperClassPackage(o:*):String

Retrieves the super class package of the target instance or type (Class).

Parameters

o:* — The target instance or type (Class).

Returns
String — The package string representation of the target instance or type (Class).
getSuperClassPath()method 
public static function getSuperClassPath(o:*):String

Retrieves the full qualified class name of the super class of the target instance or type (Class).

Parameters

o:* — The target instance or type (Class).

Returns
String — The full qualified class name string representation (package + name) of the super class of the target instance or type (Class).
superClassNameEquals()method 
public static function superClassNameEquals(o1:*, o2:*):Boolean

Performs the comparison between the two arguments using the getSuperClassName() method.

Parameters

o1:* — The first instance or type (Class) to be compared.
 
o2:* — The second instance or type (Class) to be compared.

Returns
BooleanTrue if the super class names are equal.
superClassPackageEquals()method 
public static function superClassPackageEquals(o1:*, o2:*):Boolean

Performs the comparison between the two arguments using the getSuperClassPackage() method.

Parameters

o1:* — The first instance or type (Class) to be compared.
 
o2:* — The second instance or type (Class) to be compared.

Returns
BooleanTrue if the class packages are equal.
superClassPathEquals()method 
public static function superClassPathEquals(o1:*, o2:*):Boolean

Performs the comparison between the two arguments using the getSuperClassPath() method.

Parameters

o1:* — The first instance or type (Class) to be compared.
 
o2:* — The second instance or type (Class) to be compared.

Returns
BooleanTrue if the class path are equal.
Examples
getClassName()
     import flash.display.Sprite;
     import org.as3coreaddendum.system.Reflection;
     import org.as3coreaddendum.system.comparators.NumberComparator;
     
     var str  :String             = "";
     var s    :Sprite             = new Sprite();
     var n    :NumberComparator   = new NumberComparator();
     
     Reflection.getClassName(str)                 // String
     Reflection.getClassName(String)              // String
       
     Reflection.getClassName(s)                   // Sprite
     Reflection.getClassName(Sprite)              // Sprite
     
     Reflection.getClassName(n)                   // NumberComparator
     Reflection.getClassName(NumberComparator)    // NumberComparator
     
getClassPackage()
     import flash.display.Sprite;
     import org.as3coreaddendum.system.Reflection;
     import org.as3coreaddendum.system.comparators.NumberComparator;
     
     var str  :String             = "";
     var s    :Sprite             = new Sprite();
     var n    :NumberComparator   = new NumberComparator();
     
     Reflection.getClassPackage(str)                 // null
     Reflection.getClassPackage(String)              // null
       
     Reflection.getClassPackage(s)                   // flash.display
     Reflection.getClassPackage(Sprite)              // flash.display
     
     Reflection.getClassPackage(n)                   // org.as3coreaddendum.system.comparators
     Reflection.getClassPackage(NumberComparator)    // org.as3coreaddendum.system.comparators
     
getClassPath()
     import flash.display.Sprite;
     import org.as3coreaddendum.system.Reflection;
     import org.as3coreaddendum.system.comparators.NumberComparator;
     
     var str  :String             = "";
     var s    :Sprite             = new Sprite();
     var n    :NumberComparator   = new NumberComparator();
     
     Reflection.getClassPath(str)                 // String
     Reflection.getClassPath(String)              // String
       
     Reflection.getClassPath(s)                   // flash.display.Sprite
     Reflection.getClassPath(Sprite)              // flash.display.Sprite
     
     Reflection.getClassPath(n)                   // org.as3coreaddendum.system.comparators.NumberComparator
     Reflection.getClassPath(NumberComparator)    // org.as3coreaddendum.system.comparators.NumberComparator
     
getSuperClassName()
     import flash.display.Sprite;
     import org.as3coreaddendum.system.Reflection;
     import org.as3coreaddendum.system.comparators.NumberComparator;
     
     var str  :String             = "";
     var s    :Sprite             = new Sprite();
     var n    :NumberComparator   = new NumberComparator();
     
     Reflection.getSuperClassName(str)                 // Object
     Reflection.getSuperClassName(String)              // Object
       
     Reflection.getSuperClassName(s)                   // DisplayObjectContainer
     Reflection.getSuperClassName(Sprite)              // DisplayObjectContainer
     
     Reflection.getSuperClassName(n)                   // Object
     Reflection.getSuperClassName(NumberComparator)    // Object
     
getSuperClassPackage()
     import flash.display.Sprite;
     import org.as3coreaddendum.system.Reflection;
     import org.as3coreaddendum.system.comparators.NumberComparator;
     
     var str  :String             = "";
     var s    :Sprite             = new Sprite();
     var n    :NumberComparator   = new NumberComparator();
     
     Reflection.getSuperClassPackage(str)                 // null
     Reflection.getSuperClassPackage(String)              // null
       
     Reflection.getSuperClassPackage(s)                   // flash.display
     Reflection.getSuperClassPackage(Sprite)              // flash.display
     
     Reflection.getSuperClassPackage(n)                   // null
     Reflection.getSuperClassPackage(NumberComparator)    // null
     
getSuperClassPath()
     import flash.display.Sprite;
     import org.as3coreaddendum.system.Reflection;
     import org.as3coreaddendum.system.comparators.NumberComparator;
     
     var str  :String             = "";
     var s    :Sprite             = new Sprite();
     var n    :NumberComparator   = new NumberComparator();
     
     Reflection.getSuperClassPath(str)                 // Object
     Reflection.getSuperClassPath(String)              // Object
       
     Reflection.getSuperClassPath(s)                   // flash.display.DisplayObjectContainer
     Reflection.getSuperClassPath(Sprite)              // flash.display.DisplayObjectContainer
     
     Reflection.getSuperClassPath(n)                   // Object
     Reflection.getSuperClassPath(NumberComparator)    // Object