Packagesekati.reflect
Classpublic class ClassReflector

ClassReflector provides a centralized class reflection API.



Public Properties
 PropertyDefined by
  constructor : MethodReflector
Constructor description
ClassReflector
  description : XML
[read-only] The output of describeType
ClassReflector
  interfaces : Array
[read-only] Interfaces the Class implements
ClassReflector
  isConcrete : Boolean
[read-only] Is this a Class or an interface?
ClassReflector
  isDynamic : Boolean
[read-only] Indicates if the Class is dynamic

note: flash.utils.describeType lies to us and only returns the correct answer if you use describeType on an instance of a class, not the class itself.

ClassReflector
  isFinal : Boolean
[read-only] Is this class marked as final
ClassReflector
  isInterface : Boolean
[read-only] Is this Class an interface?
ClassReflector
  methods : Array
[read-only] Instance method descriptions
ClassReflector
  packageName : String
[read-only] The package the Class is in
ClassReflector
  properties : Array
[read-only] Instance Properties and Variables
ClassReflector
  propertiesAndMethods : Array
[read-only] All MethoddInfo instances for the properties, variables and methods of an instance of the reflected class
ClassReflector
  qualifiedName : String
[read-only] The fully qualified class name
ClassReflector
  shortName : String
[read-only] The class name without namespaces
ClassReflector
  superClasses : Array
[read-only] Classes the class extends
ClassReflector
  type : Class
[read-only] The class that was reflected
ClassReflector
Public Methods
 MethodDefined by
  
ClassReflector(o:Object)
ClassReflector Constructor
ClassReflector
  
getter(name:String):MethodReflector
Search for a getter (property, variable or method) with the specified name and return its MethodReflector
ClassReflector
  
isImplementorOf(type:Class):Boolean
Indicates if the reflected class implements the supplied type
ClassReflector
  
isSubClassOf(type:Class):Boolean
Indicates if the reflected class is a subclass of the supplied class
ClassReflector
  
method(name:String):MethodReflector
Search for a method with the specified name and return its MethodReflector
ClassReflector
  
property(name:String):MethodReflector
Search for a property or variable with the specified name and return its MethodReflector
ClassReflector
  
setter(name:String):MethodReflector
Search for a setter (property, variable or method) with the specified name and return its MethodReflector
ClassReflector
  
toString():String
ClassReflector
Property detail
constructorproperty
public var constructor:MethodReflector

Constructor description

descriptionproperty 
description:XML  [read-only]

The output of describeType

Implementation
    public function get description():XML
interfacesproperty 
interfaces:Array  [read-only]

Interfaces the Class implements

Implementation
    public function get interfaces():Array
isConcreteproperty 
isConcrete:Boolean  [read-only]

Is this a Class or an interface?

Implementation
    public function get isConcrete():Boolean
isDynamicproperty 
isDynamic:Boolean  [read-only]

Indicates if the Class is dynamic

note: flash.utils.describeType lies to us and only returns the correct answer if you use describeType on an instance of a class, not the class itself. Until a workaround is found this function will always returns false.

Implementation
    public function get isDynamic():Boolean
isFinalproperty 
isFinal:Boolean  [read-only]

Is this class marked as final

Implementation
    public function get isFinal():Boolean
isInterfaceproperty 
isInterface:Boolean  [read-only]

Is this Class an interface?

Implementation
    public function get isInterface():Boolean
methodsproperty 
methods:Array  [read-only]

Instance method descriptions

Implementation
    public function get methods():Array
packageNameproperty 
packageName:String  [read-only]

The package the Class is in

Implementation
    public function get packageName():String
propertiesproperty 
properties:Array  [read-only]

Instance Properties and Variables

Implementation
    public function get properties():Array
propertiesAndMethodsproperty 
propertiesAndMethods:Array  [read-only]

All MethoddInfo instances for the properties, variables and methods of an instance of the reflected class

Implementation
    public function get propertiesAndMethods():Array
qualifiedNameproperty 
qualifiedName:String  [read-only]

The fully qualified class name

Implementation
    public function get qualifiedName():String
shortNameproperty 
shortName:String  [read-only]

The class name without namespaces

Implementation
    public function get shortName():String
superClassesproperty 
superClasses:Array  [read-only]

Classes the class extends

Implementation
    public function get superClasses():Array
typeproperty 
type:Class  [read-only]

The class that was reflected

Implementation
    public function get type():Class
Constructor detail
ClassReflector()constructor
public function ClassReflector(o:Object)

ClassReflector Constructor

Parameters
o:Object — - Class or class instance to be reflected.
Method detail
getter()method
public function getter(name:String):MethodReflector

Search for a getter (property, variable or method) with the specified name and return its MethodReflector

Parameters
name:String — The getter name to search for

Returns
MethodReflector — The MethodReflector for the getter if it exists
isImplementorOf()method 
public function isImplementorOf(type:Class):Boolean

Indicates if the reflected class implements the supplied type

Parameters
type:Class

Returns
Boolean
isSubClassOf()method 
public function isSubClassOf(type:Class):Boolean

Indicates if the reflected class is a subclass of the supplied class

Parameters
type:Class

Returns
Boolean
method()method 
public function method(name:String):MethodReflector

Search for a method with the specified name and return its MethodReflector

Parameters
name:String — The method name to search for

Returns
MethodReflector — The MethodReflector for the method if it exists
property()method 
public function property(name:String):MethodReflector

Search for a property or variable with the specified name and return its MethodReflector

Parameters
name:String — The property or variable name to search for

Returns
MethodReflector — The MethodReflector for the property if it exists
setter()method 
public function setter(name:String):MethodReflector

Search for a setter (property, variable or method) with the specified name and return its MethodReflector

Parameters
name:String — The setter name to search for

Returns
MethodReflector — The MethodReflector for the setter if it exists
toString()method 
public function toString():String

Returns
String