Packageflex.lang.reflect
Classpublic class Method
InheritanceMethod Inheritance Object

An object representing a method of a class or instance. You can invoke the method as well as inspect its metadata.



Public Properties
 PropertyDefined By
  declaringClass : Class
[read-only] Returns the the class where this Method is defined.
Method
  elementType : Class
[read-only] If the return type is an array, returns the type of each element
Method
  isStatic : Boolean
[read-only] Returns true if the method is static and false if it is an instance method
Method
  metadata : Array
[read-only] Returns an array of MetaDataAnnotation instances associated with this Method.
Method
  methodXML : XML
[read-only] Returns the XML used to build this Method
Method
  name : String
[read-only] Returns the name of the Method
Method
  parameterTypes : Array
[read-only] Returns the Method parameter types as an array.
Method
  returnType : Class
[read-only] Returns the return type of the Method
Method
Public Methods
 MethodDefined By
  
Method(methodXML:XML, isStatic:Boolean = false)
Constructor Parses <method/> nodes returned from a call to <code>describeType</code> to provide an object wrapper for Methods Expected format of the argument is <method name="someMethod" declaredBy="tests::SomeClass" returnType="void"> <metadata name="Before"> <arg key="order" value="2"/> </metadata> </method>
Method
  
apply(obj:Object, argArray:*):*
Calls apply on the method
Method
  
Clones the existing method
Method
  
equals(item:Method):Boolean
Compares two Method instances for equality
Method
  
Returns the MetaDataAnnotation associated with a given annotation using the annotation's name
Method
  
hasMetaData(name:String):Boolean
Checks for the existance of a metadata annotation using the annotation's name
Method
  
invoke(obj:Object, ... args):Object
Calls apply on the method
Method
Property Detail
declaringClassproperty
declaringClass:Class  [read-only]

Returns the the class where this Method is defined.


Implementation
    public function get declaringClass():Class
elementTypeproperty 
elementType:Class  [read-only]

If the return type is an array, returns the type of each element


Implementation
    public function get elementType():Class
isStaticproperty 
isStatic:Boolean  [read-only]

Returns true if the method is static and false if it is an instance method


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

Returns an array of MetaDataAnnotation instances associated with this Method.


Implementation
    public function get metadata():Array
methodXMLproperty 
methodXML:XML  [read-only]

Returns the XML used to build this Method


Implementation
    public function get methodXML():XML
nameproperty 
name:String  [read-only]

Returns the name of the Method


Implementation
    public function get name():String
parameterTypesproperty 
parameterTypes:Array  [read-only]

Returns the Method parameter types as an array.


Implementation
    public function get parameterTypes():Array
returnTypeproperty 
returnType:Class  [read-only]

Returns the return type of the Method


Implementation
    public function get returnType():Class
Constructor Detail
Method()Constructor
public function Method(methodXML:XML, isStatic:Boolean = false)

Constructor Parses <method/> nodes returned from a call to <code>describeType</code> to provide an object wrapper for Methods Expected format of the argument is <method name="someMethod" declaredBy="tests::SomeClass" returnType="void"> <metadata name="Before"> <arg key="order" value="2"/> </metadata> </method>

Parameters
methodXML:XML — <metadata/> XML node.
 
isStatic:Boolean (default = false)
Method Detail
apply()method
public function apply(obj:Object, argArray:*):*

Calls apply on the method

Parameters

obj:Object — the item to call
 
argArray:* — the paramaters to call with apply, if any

Returns
* — return value of the method

See also

clone()method 
public function clone():Method

Clones the existing method

Returns
Method — a new Method
equals()method 
public function equals(item:Method):Boolean

Compares two Method instances for equality

Parameters

item:Method

Returns
Boolean — Returns boolean indicating equality
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.
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

invoke()method 
public function invoke(obj:Object, ... args):Object

Calls apply on the method

Parameters

obj:Object — the item to call
 
... args — the paramaters to call with apply, if any

Returns
Object — return value of the method

See also