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

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

An object representing a property or variable of a class or instance. You can gain access to the value of the field as well as inspect its metadata.

Public Properties

| Property | Defined By
--- | --- | ---
|  | definedBy : Class [read-only] Returns the Class that defines this field. | Field
|  | elementType : Class [read-only] Retrieves the element type of the Field | Field
|  | isProperty : Boolean [read-only] Returns whether the Field is a property. | Field
|  | isStatic : Boolean [read-only] Returns whether the Field is static. | Field
|  | metadata : Array [read-only] Retrieves an array of MetaDataAnnotation instances associated with the Field | Field
|  | name : String [read-only] Retrieves the name of the Field | Field
|  | type : Class [read-only] Retrieves the Class associated with the Field | Field

Public Methods

| Method | Defined By
--- | --- | ---
|  | Field(fieldXML:XML, isStatic:Boolean, definedBy:Class, isProperty:Boolean) Field Constructor | Field
|  | equals(item:Field):Boolean Compares two Field instances for equality | Field
|  | getMetaData(name:String):MetaDataAnnotation Returns the MetaDataAnnotation associated with a given annotation using the annotation's name | Field
|  | getObj(obj:Object = null):Object Retrieves the actual field represented by this Field object within the instance or class where it exists. | Field
|  | hasMetaData(name:String):Boolean Checks for the existance of a metadata annotation using the annotation's name | Field

Property Detail

definedBy | property

`definedBy:Class` [read-only]

Returns the Class that defines this field.

Implementation
`public function get definedBy():Class`

elementType | property |

`elementType:Class` [read-only]

Retrieves the element type of the `Field`

Implementation
`public function get elementType():Class`

isProperty | property |

`isProperty:Boolean` [read-only]

Returns whether the `Field` is a property. Fields are either properties (getter/setters) or variables.

Implementation
`public function get isProperty():Boolean`

isStatic | property |

`isStatic:Boolean` [read-only]

Returns whether the `Field` is static.

Implementation
`public function get isStatic():Boolean`

metadata | property |

`metadata:Array` [read-only]

Retrieves an array of MetaDataAnnotation instances associated with the `Field`

Implementation
`public function get metadata():Array`

name | property |

`name:String` [read-only]

Retrieves the name of the `Field`

Implementation
`public function get name():String`

type | property |

`type:Class` [read-only]

Retrieves the `Class` associated with the `Field`

Implementation
`public function get type():Class`
Constructor Detail

Field | () | Constructor

`public function Field(fieldXML:XML, isStatic:Boolean, definedBy:Class, isProperty:Boolean)`

`Field` Constructor

Parameters

| `fieldXML:XML` — XML that describes the `Field` to be created
| `isStatic:Boolean` — `true` if `Field` is static, else `false`
| `definedBy:Class` — `Class` that defines the `Field` to be created
| `isProperty:Boolean` — `true` if the `Field` is a property, else `false`

Method Detail

equals | () | method

`public function equals(item:Field):Boolean`

Compares two Field instances for equality

Parameters

| `item:Field`

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.

getObj | () | method |

`public function getObj(obj:Object = null):Object`

Retrieves the actual field represented by this Field object within the instance or class where it exists. If an object is passed, then this field is returned from that object instance. If a null argument is passed and the field is static, then the field is treated as static and returned from the class. If a null argument is passed and the field is NOT static, then an error is thrown.

Parameters

| `obj:Object` (default = `null`)`` — An instance where the field exists

Returns

| `Object` — The object represented by this Field within the specified object or class.

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()

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