Packageorg.as3commons.reflect
Classpublic class Type
InheritanceType Inheritance MetadataContainer Inheritance Object

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
  currentApplicationDomain : ApplicationDomain
[static] [read-only]
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
  interfaces : Array
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
[read-only] 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
  parameters : Array
[read-only]
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
  typeProviderKind : TypeProviderKind
[static]
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
  
Type
  
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, ns:String = null):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
  
getMetadataContainers(name:String):Array
Retrieves an Array of MetadataContainer instances that are associated with the current Type that contain Metadata with the specified name.
Type
  
getMethod(name:String, ns:String = null):Method
Returns the Method object for the method in this type with the given name.
Type
  
[static]
Type
 Inherited
hasExactMetadata(otherMetadata:Metadata):Boolean
MetadataContainer
 Inherited
hasMetadata(key:String):Boolean
Returns whether this object has meta data for the given key.
MetadataContainer
  
reset():void
[static] Clears the cache and set typeProvider to null.
Type
Public Constants
 ConstantDefined By
  PRIVATE : Type
[static]
Type
  UNTYPED : Type
[static]
Type
  VOID : Type
[static]
Type
  VOID_NAME : String = void
[static]
Type
Property Detail
accessorsproperty
accessors:Array

An array of Accessor instances


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

See also

aliasproperty 
alias:String


Implementation
    public function get alias():String
    public function set alias(value:String):void
applicationDomainproperty 
applicationDomain:ApplicationDomain

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

The Class of the Type


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

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 
constructor:Constructor

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


Implementation
    public function get constructor():Constructor
    public function set constructor(value:Constructor):void

See also

currentApplicationDomainproperty 
currentApplicationDomain:ApplicationDomain  [read-only]


Implementation
    public static function get currentApplicationDomain():ApplicationDomain
extendsClassesproperty 
extendsClasses:Array


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

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


Implementation
    public function get fullName():String
    public function set fullName(value:String):void
interfacesproperty 
interfaces:Array


Implementation
    public function get interfaces():Array
    public function set interfaces(value:Array):void
isDynamicproperty 
isDynamic:Boolean

True if the Type is dynamic


Implementation
    public function get isDynamic():Boolean
    public function set isDynamic(value:Boolean):void
isFinalproperty 
isFinal:Boolean

True if the Type is final


Implementation
    public function get isFinal():Boolean
    public function set isFinal(value:Boolean):void
isInterfaceproperty 
isInterface:Boolean

True if the Type is an interface


Implementation
    public function get isInterface():Boolean
    public function set isInterface(value:Boolean):void
isStaticproperty 
isStatic:Boolean

True if the Type is static


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

An array of Method instances


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

See also

nameproperty 
name:String

The name of the type


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


Implementation
    public function get parameters():Array
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

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

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

typeProviderKindproperty 
public static var typeProviderKind:TypeProviderKind

variablesproperty 
variables:Array

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
createMetadataLookup()method
public function createMetadataLookup():void

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, ns:String = null):Field

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

Parameters

name:String — the name of the field
 
ns:String (default = null)

Returns
Field
getMetadataContainers()method 
public function getMetadataContainers(name:String):Array

Retrieves an Array of MetadataContainer instances that are associated with the current Type that contain Metadata with the specified name.

Each MetadataContainer instance can be one of these subclasses:

Parameters

name:String — The specified Metadata name.

Returns
Array — An Array of MetadataContainer instances.
getMethod()method 
public function getMethod(name:String, ns:String = null):Method

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

Parameters

name:String — the name of the method
 
ns:String (default = null)

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

Returns
ITypeProvider
reset()method 
public static function reset():void

Clears the cache and set typeProvider to null.

setParameters()method 
as3commons_reflect function setParameters(value:Array):void

Parameters

value:Array

Constant Detail
PRIVATEConstant
public static const PRIVATE:Type

UNTYPEDConstant 
public static const UNTYPED:Type

VOIDConstant 
public static const VOID:Type

VOID_NAMEConstant 
public static const VOID_NAME:String = void