Interface org.as2lib.env.reflect.TypeInfo

Description

TypeInfo represents a type a ActionScript type, that is either a class or an interface.

Note that it is not possible right now to distinguish between classes and interfaces at run-time. Therefore are both classes and interfaces represented by ClassInfo instances. This is going to change as soon is a differentiation is possible.

Method Index

getMethod(), getMethodByMethod(), getMethodByName(), getMethods(), getMethodsByFilter(), getMethodsByFlag(), getPackage(), getSuperType(), getType(), hasMethod()

Inherited from PackageMemberInfo

Inherited from MemberInfo

Inherited from BasicInterface

Method Detail

getType

public function getType(Void):Function

Returns the type this instance represents.

Return

the type represented by this instance

getSuperType

public function getSuperType(Void):TypeInfo

Returns the super type of this type.

Talking of classes the super-type is the class's super-class, that means the class it extends and with interfaces it is the interface's super-interface, that means the interface it extends.

A super-type is not an implemented interface. Note the difference between extending and implementing.

Return

the super types of this type

getPackage

public function getPackage(Void):PackageInfo

Returns the package this type is a member of.

Return

the package this type is a member of

hasMethod

public function hasMethod(methodName:String, filterStaticMethods:Boolean):Boolean

Returns whether this type or any super-type has a method with the passed-in methodName.

Static methods are not filtered by default. This means filterStaticMethods is by default set to false.

Parameters

methodNamethe name of the method to search for
filterStaticMethods(optional) determines whether static methods are filtered, this means excluded from the search

Return

true if the method exists else false

getMethods

public function getMethods():Array

getMethodsByFlag

public function getMethodsByFlag(filterSuperTypes:Boolean):Array

Returns an array containing the methods represented by MethodInfo instances this type declares and maybe the ones of the super types.

The super types' methods are included if you pass-in false, null or undefined and excluded/filtered if you pass-in true. This means super-types are by default included.

Note that methods of interfaces cannot be evaluated at run-time. They thus have no methods for the Reflection API.

Parameters

filterSuperTypes(optional) determines whether to filter/exclude the super types' methods

Return

an array containing the methods represented by MethodInfo instances

getMethodsByFilter

public function getMethodsByFilter(methodFilter:TypeMemberFilter):Array

Returns an array containing the methods represented by MethodInfo instances this type and super types' declare that are not filtered/excluded.

The TypeMemberFilter.filter method of the passed-in methodFilter is invoked for every method to determine whether it shall be contained in the result.

If the passed-in methodFilter is null or undefined the result of an invocation of the getMethodsByFlag method with argument false will be returned.

Note that methods of interfaces cannot be evaluated at run-time. They thus have no methods for the Reflection API.

Parameters

methodFilterthe filter that filters unwanted methods out

Return

an array containing the remaining methods represented by MethodInfo instances

getMethod

public function getMethod():MethodInfo

getMethodByName

public function getMethodByName(methodName:String):MethodInfo

Returns the method info corresponding to the passed-in methodName.

null will be returned if:

  • The passed-in methodName is null or undefined.
  • The method does not exist in the represented type or any super-type.

Note that methods of interfaces cannot be evaluated at run-time. They thus have no methods for the Reflection API.

Parameters

methodNamethe name of the method you wanna obtain

Return

the method info correspoinding to the passed-in methodName

getMethodByMethod

public function getMethodByMethod(concreteMethod:Function):MethodInfo

Returns the method info corresponding to the passed-in concreteMethod.

null will be returned if:

  • The passed-in concreteMethod is null or undefined.
  • The method does not exist in the represented type or any super-type.

Note that methods of interfaces cannot be evaluated at run-time. They thus have no methods for the Reflection API.

Parameters

concreteMethodthe method you wanna obtain the corresponding method info for

Return

the method info correspoinding to the passed-in concreteMethod