Packageorg.as3commons.reflect
Classpublic class Type
InheritanceType Inheritance MetaDataContainer

Provides information about the characteristics of a class or an interface. These are the methods, accessors (getter/setter), variables and constants, but also if the class is dynamic and final.

Note that information about an object cannot be retrieved by calling the Type constructor. Instead use one of the following static methods:

In case of an instance: var type:Type = Type.forInstance(myInstance);

In case of a Class variable: var type:Type = Type.forClass(MyClass);

In case of a classname: var type:Type = Type.forName("MyClass");



Public Properties
 PropertyDefined by
  accessors : Array
An array of Accessor instances
Type
  alias : String
Type
  applicationDomain : ApplicationDomain
The ApplicationDomain which is able to retrieve the object definition for this type.
Type
  clazz : Class
The Class of the Type
Type
  constants : Array
An array of IMember instances that describe the constants of the Type
Type
  constructor : Constructor
A reference to a Constructor instance that describes the constructor of the Type
Type
  extendsClasses : Array
Type
  fields : Array
[read-only] An array of all the static constants, constants, static variables and variables of the Type
Type
  fullName : String
The fully qualified name of the type, this includes the namespace
Type
  isDynamic : Boolean
True if the Type is dynamic
Type
  isFinal : Boolean
True if the Type is final
Type
  isInterface : Boolean
True if the Type is an interface
Type
  isStatic : Boolean
True if the Type is static
Type
 InheritedmetaData : Array
Returns an array of all metadata objects in this container.
MetaDataContainer
  methods : Array
An array of Method instances
Type
  name : String
The name of the type
Type
  properties : Array
[read-only] An array of Field containing all accessors and variables for the type.
Type
  staticConstants : Array
An array of IMember instances that describe the static constants of the Type
Type
  staticVariables : Array
An array of IMember instances that describe the static variables of the Type
Type
  variables : Array
An array of IMember instances that describe the variables of the Type
Type
Public Methods
 MethodDefined by
  
Type(applicationDomain:ApplicationDomain)
Creates a new Type instance.
Type
 Inherited
addMetaData(metaData:MetaData):void
Adds a MetaData object to this container.
MetaDataContainer
  
forClass(clazz:Class, applicationDomain:ApplicationDomain = null):Type
[static] Returns a Type object that describes the given class.
Type
  
forInstance(instance:*, applicationDomain:ApplicationDomain = null):Type
[static] Returns a Type object that describes the given instance.
Type
  
forName(name:String, applicationDomain:ApplicationDomain = null):Type
[static] Returns a Type object that describes the given classname.
Type
  
getField(name:String):Field
Returns the Field object for the field in this type with the given name.
Type
 Inherited
getMetaData(key:String):Array
Returns the array of MetaData object that corresponds to the given key.
MetaDataContainer
  
getMethod(name:String):Method
Returns the Method object for the method in this type with the given name.
Type
  
[static]
Type
 Inherited
hasMetaData(key:String):Boolean
Returns whether this object has meta data for the given key.
MetaDataContainer
Protected Methods
 MethodDefined by
  
initType(applicationDomain:ApplicationDomain):void
Initializes the current Type instance.
Type
Public Constants
 ConstantDefined by
  PRIVATE : Type
[static]
Type
  UNTYPED : Type
[static]
Type
  VOID : Type
[static]
Type
Property detail
accessorsproperty
accessors:Array  [read-write]

An array of Accessor instances

Implementation
    public function get accessors():Array
    public function set accessors(value:Array):void

See also

aliasproperty 
alias:String  [read-write]Implementation
    public function get alias():String
    public function set alias(value:String):void
applicationDomainproperty 
applicationDomain:ApplicationDomain  [read-write]

The ApplicationDomain which is able to retrieve the object definition for this type. The definition does not necessarily have to be part of this ApplicationDomain, it could possibly be present in the parent domain as well.

Implementation
    public function get applicationDomain():ApplicationDomain
    public function set applicationDomain(value:ApplicationDomain):void
clazzproperty 
clazz:Class  [read-write]

The Class of the Type

Implementation
    public function get clazz():Class
    public function set clazz(value:Class):void
constantsproperty 
constants:Array  [read-write]

An array of IMember instances that describe the constants of the Type

Implementation
    public function get constants():Array
    public function set constants(value:Array):void

See also

constructorproperty 
public var constructor:Constructor

A reference to a Constructor instance that describes the constructor of the Type

See also

extendsClassesproperty 
extendsClasses:Array  [read-write]

Implementation
    public function get extendsClasses():Array
    public function set extendsClasses(value:Array):void
fieldsproperty 
fields:Array  [read-only]

An array of all the static constants, constants, static variables and variables of the Type

Implementation
    public function get fields():Array

See also

fullNameproperty 
fullName:String  [read-write]

The fully qualified name of the type, this includes the namespace

Implementation
    public function get fullName():String
    public function set fullName(value:String):void
isDynamicproperty 
isDynamic:Boolean  [read-write]

True if the Type is dynamic

Implementation
    public function get isDynamic():Boolean
    public function set isDynamic(value:Boolean):void
isFinalproperty 
isFinal:Boolean  [read-write]

True if the Type is final

Implementation
    public function get isFinal():Boolean
    public function set isFinal(value:Boolean):void
isInterfaceproperty 
isInterface:Boolean  [read-write]

True if the Type is an interface

Implementation
    public function get isInterface():Boolean
    public function set isInterface(value:Boolean):void
isStaticproperty 
isStatic:Boolean  [read-write]

True if the Type is static

Implementation
    public function get isStatic():Boolean
    public function set isStatic(value:Boolean):void
methodsproperty 
methods:Array  [read-write]

An array of Method instances

Implementation
    public function get methods():Array
    public function set methods(value:Array):void

See also

nameproperty 
name:String  [read-write]

The name of the type

Implementation
    public function get name():String
    public function set name(value:String):void
propertiesproperty 
properties:Array  [read-only]

An array of Field containing all accessors and variables for the type.

Implementation
    public function get properties():Array

See also

staticConstantsproperty 
staticConstants:Array  [read-write]

An array of IMember instances that describe the static constants of the Type

Implementation
    public function get staticConstants():Array
    public function set staticConstants(value:Array):void

See also

staticVariablesproperty 
staticVariables:Array  [read-write]

An array of IMember instances that describe the static variables of the Type

Implementation
    public function get staticVariables():Array
    public function set staticVariables(value:Array):void

See also

variablesproperty 
variables:Array  [read-write]

An array of IMember instances that describe the variables of the Type

Implementation
    public function get variables():Array
    public function set variables(value:Array):void

See also

Constructor detail
Type()constructor
public function Type(applicationDomain:ApplicationDomain)

Creates a new Type instance.

Parameters
applicationDomain:ApplicationDomain
Method detail
forClass()method
public static function forClass(clazz:Class, applicationDomain:ApplicationDomain = null):Type

Returns a Type object that describes the given class.

Parameters
clazz:Class — the class from which to get a type description
 
applicationDomain:ApplicationDomain (default = null)

Returns
Type
forInstance()method 
public static function forInstance(instance:*, applicationDomain:ApplicationDomain = null):Type

Returns a Type object that describes the given instance.

Parameters
instance:* — the instance from which to get a type description
 
applicationDomain:ApplicationDomain (default = null)

Returns
Type
forName()method 
public static function forName(name:String, applicationDomain:ApplicationDomain = null):Type

Returns a Type object that describes the given classname.

Parameters
name:String — the classname from which to get a type description
 
applicationDomain:ApplicationDomain (default = null)

Returns
Type
getField()method 
public function getField(name:String):Field

Returns the Field object for the field in this type with the given name.

Parameters
name:String — the name of the field

Returns
Field
getMethod()method 
public function getMethod(name:String):Method

Returns the Method object for the method in this type with the given name.

Parameters
name:String — the name of the method

Returns
Method
getTypeProvider()method 
public static function getTypeProvider():ITypeProvider

Returns
ITypeProvider
initType()method 
protected function initType(applicationDomain:ApplicationDomain):void

Initializes the current Type instance.

Parameters
applicationDomain:ApplicationDomain
Constant detail
PRIVATEconstant
public static const PRIVATE:Type
UNTYPEDconstant 
public static const UNTYPED:Type
VOIDconstant 
public static const VOID:Type