API Documentation | All Packages | All Classes | Index | Frames No Frames |
Klass

Package | flex.lang.reflect
Class | public class Klass
Inheritance | Klass 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

| Property | Defined 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

| Method | Defined 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
|  | getMetaData(name:String):MetaDataAnnotation 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

asClass | property

`asClass:Class` [read-only]

Returns the `Class` definition defined by the Klass

Implementation
`public function get asClass():Class`

classDef | property |

`classDef:Class` [read-only]

Returns the `Class` definition

Implementation
`public function get classDef():Class`

classInheritance | property |

`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`

constructor | property |

`constructor:Constructor` [read-only]

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

Implementation
`public function get constructor():Constructor`

See also

Constructor

constructorXML | property |

`constructorXML:XML` [read-only]

Implementation
`public function get constructorXML():XML`

fields | property |

`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

Field

interfaces | property |

`interfaces:Array` [read-only]

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

Implementation
`public function get interfaces():Array`

isInterface | property |

`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`

metadata | property |

`metadata:Array` [read-only]

Returns an Array of MetaDataAnnotation instances decorating the Class

Implementation
`public function get metadata():Array`

methods | property |

`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

Method

name | property |

`name:String` [read-only]

Returns the name of the `Class`

Implementation
`public function get name():String`

packageName | property |

`packageName:String` [read-only]

Returns the package name that of the `Class`.

Implementation
`public function get packageName():String`

superClass | property |

`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

| `Boolean` — `true` 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

| `Class` — `Class` 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

Field

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

Method

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

getMetaData()

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`

Thu Apr 10 2014, 08:07 AM +10:00