Packageflex.lang.reflect
Classpublic class Klass
InheritanceKlass Inheritance Object

Takes a Class defintion and converts it into an XML form this Klass is then used by FlexUnit to run methods associated with the Class



Public Properties
 PropertyDefined By
  asClass : Class
[read-only] Returns the Class definition defined by the Klass
Klass
  classDef : Class
[read-only] Returns the Class definition
Klass
  classInheritance : Array
[read-only] Returns an array of classes representing each super class in the chain between the current class and Object.
Klass
  constructor : Constructor
[read-only] Returns a Constructor instance that represents the constructor for this class.
Klass
  constructorXML : XML
[read-only]
Klass
  fields : Array
[read-only] Returns an Array of Field instances representing the individual static and instance properties and variables of the class.
Klass
  interfaces : Array
[read-only] Returns an Array of Class objects representing each interfaces implemented by the Class
Klass
  isInterface : Boolean
[read-only] Indicates if this class is actually interface.
Klass
  metadata : Array
[read-only] Returns an Array of MetaDataAnnotation instances decorating the Class
Klass
  methods : Array
[read-only] Returns an Array of Method instances representing the static and instance methods of this class.
Klass
  name : String
[read-only] Returns the name of the Class
Klass
  packageName : String
[read-only] Returns the package name that of the Class.
Klass
  superClass : Class
[read-only] Returns the super class.
Klass
Public Methods
 MethodDefined By
  
Klass(clazz:Class)
Klass Constructor
Klass
  
descendsFrom(clazz:Class):Boolean
Tests whether the class extends from the specified class
Klass
  
getClassFromName(name:String):Class
[static] Static method.
Klass
  
getField(name:String):Field
Returns the Field matching the paramater name.
Klass
  
Returns the MetaDataAnnotation associated with a given annotation using the annotation's name
Klass
  
getMethod(name:String):Method
Returns the Method instance with the provided name.
Klass
  
hasMetaData(name:String):Boolean
Checks for the existance of a metadata annotation using the annotation's name
Klass
  
implementsInterface(interfaceRef:Class):Boolean
Tests whether the class implements a provided interface
Klass
  
refreshClassXML(clazz:Class):void
Klass
Property Detail
asClassproperty
asClass:Class  [read-only]

Returns the Class definition defined by the Klass


Implementation
    public function get asClass():Class
classDefproperty 
classDef:Class  [read-only]

Returns the Class definition


Implementation
    public function get classDef():Class
classInheritanceproperty 
classInheritance:Array  [read-only]

Returns an array of classes representing each super class in the chain between the current class and Object.


Implementation
    public function get classInheritance():Array
constructorproperty 
constructor:Constructor  [read-only]

Returns a Constructor instance that represents the constructor for this class.


Implementation
    public function get constructor():Constructor

See also

constructorXMLproperty 
constructorXML:XML  [read-only]


Implementation
    public function get constructorXML():XML
fieldsproperty 
fields:Array  [read-only]

Returns an Array of Field instances representing the individual static and instance properties and variables of the class.


Implementation
    public function get fields():Array

See also

interfacesproperty 
interfaces:Array  [read-only]

Returns an Array of Class objects representing each interfaces implemented by the Class


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

Indicates if this class is actually interface. In ActionScript, you can't easily tell the difference as both are of Class type.


Implementation
    public function get isInterface():Boolean
metadataproperty 
metadata:Array  [read-only]

Returns an Array of MetaDataAnnotation instances decorating the Class


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

Returns an Array of Method instances representing the static and instance methods of this class.


Implementation
    public function get methods():Array

See also

nameproperty 
name:String  [read-only]

Returns the name of the Class


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

Returns the package name that of the Class.


Implementation
    public function get packageName():String
superClassproperty 
superClass:Class  [read-only]

Returns the super class.


Implementation
    public function get superClass():Class
Constructor Detail
Klass()Constructor
public function Klass(clazz:Class)

Klass Constructor

Parameters
clazz:Class — to create as an XML Klass
Method Detail
descendsFrom()method
public function descendsFrom(clazz:Class):Boolean

Tests whether the class extends from the specified class

Parameters

clazz:Class — the class to test against

Returns
Booleantrue if the class extends from the specified class
getClassFromName()method 
public static function getClassFromName(name:String):Class

Static method. Returns the Class defined by the provided name

Parameters

name:String — of the class definition needed in package.subpackage::Class format.

Returns
ClassClass definition if found, null if not found.
getField()method 
public function getField(name:String):Field

Returns the Field matching the paramater name.

Parameters

name:String — Name of the Field as a String

Returns
Field — A reference to the Field if found. Null if not found.

See also

getMetaData()method 
public function getMetaData(name:String):MetaDataAnnotation

Returns the MetaDataAnnotation associated with a given annotation using the annotation's name

Parameters

name:String — the name of the annotation

Returns
MetaDataAnnotation — the MetaDataAnnotation instance for the annotation name, or null if it was not found.
getMethod()method 
public function getMethod(name:String):Method

Returns the Method instance with the provided name.

Parameters

name:String — the name of the Method

Returns
Method

See also

hasMetaData()method 
public function hasMetaData(name:String):Boolean

Checks for the existance of a metadata annotation using the annotation's name

Parameters

name:String — the name of the annotation

Returns
Boolean — Returns true if the annotation exists, false if it does not.

See also

implementsInterface()method 
public function implementsInterface(interfaceRef:Class):Boolean

Tests whether the class implements a provided interface

Parameters

interfaceRef:Class — The interface to test against

Returns
Boolean — true if the class implements the interface
refreshClassXML()method 
public function refreshClassXML(clazz:Class):void

Parameters

clazz:Class