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

Package | flex.lang.reflect
Class | public class Method
Inheritance | Method Object

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

Public Properties

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

| Method | Defined 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
|  | clone():Method Clones the existing method | Method
|  | equals(item:Method):Boolean Compares two Method instances for equality | Method
|  | getMetaData(name:String):MetaDataAnnotation 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

declaringClass | property

`declaringClass:Class` [read-only]

Returns the the class where this `Method` is defined.

Implementation
`public function get declaringClass():Class`

elementType | property |

`elementType:Class` [read-only]

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

Implementation
`public function get elementType():Class`

isStatic | property |

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

metadata | property |

`metadata:Array` [read-only]

Returns an array of `MetaDataAnnotation` instances associated with this `Method`.

Implementation
`public function get metadata():Array`

methodXML | property |

`methodXML:XML` [read-only]

Returns the XML used to build this `Method`

Implementation
`public function get methodXML():XML`

name | property |

`name:String` [read-only]

Returns the name of the `Method`

Implementation
`public function get name():String`

parameterTypes | property |

`parameterTypes:Array` [read-only]

Returns the `Method` parameter types as an array.

Implementation
`public function get parameterTypes():Array`

returnType | property |

`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

invoke()

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

getMetaData()

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

apply()

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