| Package | org.granite.reflect |
| Class | public class Field |
| Inheritance | Field Member DescribedElement |
| Implements | IVisitableElement |
Field instance represents either a constant, a variable or an
accessor (get/set), static or not, of a given ActionScript 3 class (only accessors
for interfaces).
See also
| Property | Defined by | ||
|---|---|---|---|
![]() | annotations : Array
An array that contains all annotations directly attached to this
IAnnotatedElement. | Member | |
![]() | declaredBy : Type
The
Type instance this described element belongs to. | DescribedElement | |
| name : String [read-only]
The name of this
Field instance, ie. | Field | ||
![]() | ns : Namespace
The namespace of this
Member. | Member | |
![]() | propertyKey : String
The String representation of this member (field or method qName, key of a
dynamic property or dictionary, index of an array, etc.)
| Member | |
![]() | qName : QName
The qualified name of this
Member. | Member | |
| type : Type
[read-only]
The type of this
Field instance, ie. | Field | ||
| uri : String [read-only]
The namespace's uri of this field ("" for public fields).
| Field | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructs a new
Field instance. | Field | ||
![]() |
equals(o:*):Boolean
Tells if this
DescribedElement instance is equal to the supplied
o parameter. | DescribedElement | |
|
getAnnotation(type:String, recursive:Boolean = false):Annotation
Returns the first
Annotation whose name is equal to the supplied type parameter,
attached to this IAnnotatedElement. | Field | ||
|
getAnnotations(recursive:Boolean = false, pattern:String = "^_?[^_]"):Array
Returns an array (possibly empty) that contains all annotations attached to this
IAnnotatedElement. | Field | ||
|
getValue(instance:*):*
Returns the value of the field represented by this Field, on the specified instance.
| Field | ||
![]() |
isAccessor():Boolean
Checks if this member is an accessor (get/set) field.
| Member | |
|
isAnnotationPresent(type:String, recursive:Boolean = false):Boolean
Tests if an
Annotation, whose name is equal to the supplied type parameter, is attached
to this IAnnotatedElement. | Field | ||
![]() |
isConstant():Boolean
Checks if this member is a constant field.
| Member | |
![]() |
isConstructor():Boolean
Checks if this member is a constructor.
| Member | |
![]() |
isDynamicProperty():Boolean
Checks if this member is a dynamic property (always
false for
Member, always true for DynamicProperty). | Member | |
![]() |
isInNamespace(ns:Namespace):Boolean
Tells if this
Member instance is declared in the the suplied ns
namespace parameter. | Member | |
![]() |
isMethod():Boolean
Checks if this member is a method.
| Member | |
![]() |
isReadable():Boolean
Checks if this member is readable (fields only).
| Member | |
![]() |
isStatic():Boolean
Checks if this member is static.
| Member | |
![]() |
isVariable():Boolean
Checks if this member is a variable field.
| Member | |
![]() |
isWriteable():Boolean
Checks if this member is writeable (fields only).
| Member | |
|
setValue(instance:*, value:*):void
Sets the field represented by this Field object on the specified instance argument to
the specified new value.
| Field | ||
![]() |
toString():String
Returns the a string (XML) representation of this described element.
| DescribedElement | |
| name | property |
name:String [read-only]
The name of this Field instance, ie. the name of the underlying
constant, variable or accessor.
public function get name():String
| type | property |
type:Type [read-only]
The type of this Field instance, ie. the type of the underlying
constant, variable or accessor.
public function get type():Type
| uri | property |
uri:String [read-only]The namespace's uri of this field ("" for public fields).
Implementation public function get uri():String
| Field | () | constructor |
public function Field(declaredBy:Type, desc:XML)
Constructs a new Field instance.
The declaredBy parameter is adjusted in order to match the actual type that
declares this field, by introspecting superclasses (or superinterfaces for
interface types). Hence, the returned value of the Field.declaredBy
accessor may not return the declaredBy parameter value, but one of its
superclasses.
declaredBy:Type — the Type that declares this field.
|
|
desc:XML — the XML description of this annotation.
|
| getAnnotation | () | method |
public override function getAnnotation(type:String, recursive:Boolean = false):Annotation
Returns the first Annotation whose name is equal to the supplied type parameter,
attached to this IAnnotatedElement.
type:String — the name of the annotation to look for.
|
|
recursive:Boolean (default = false) — should we look for annotations attached to overridden elements (non-static
accessors or methods) or superclasses/superinterfaces ?
|
Annotation —
an Annotation instance or null if it cannot be found.
|
| getAnnotations | () | method |
public override function getAnnotations(recursive:Boolean = false, pattern:String = "^_?[^_]"):Array
Returns an array (possibly empty) that contains all annotations attached to this
IAnnotatedElement.
recursive:Boolean (default = false) — should we look for annotations attached to overridden elements (non-static
accessors or methods) or superclasses/superinterfaces ?
|
|
pattern:String (default = "^_?[^_]") — a regexp expression used as a filter. Default is to eliminate all annotations
prefixed with a double '_' character. You may use this parameter to find all
annotations with a specific name.
|
Array — an array that contains all annotations attached to this IAnnotatedElement.
|
| getValue | () | method |
public function getValue(instance:*):*Returns the value of the field represented by this Field, on the specified instance.
Parametersinstance:* — object from which the represented field's value is to be extracted. This
parameter may be null if this field represents a static member.
|
* — the value of the represented field in the instance parameter.
|
IllegalAccessError — if this field is not readable.
|
|
— if this field is an instance field and the supplied instance
parameter is null, or if the instance parameter is not an instance of
this field declaring class.
|
| isAnnotationPresent | () | method |
public override function isAnnotationPresent(type:String, recursive:Boolean = false):Boolean
Tests if an Annotation, whose name is equal to the supplied type parameter, is attached
to this IAnnotatedElement.
type:String — the name of the annotation to look for.
|
|
recursive:Boolean (default = false) — should we look for annotations attached to overridden elements (non-static
accessors or methods) or superclasses/superinterfaces ?
|
Boolean — true if the annotation can be found, false otherwise.
|
| setValue | () | method |
public function setValue(instance:*, value:*):voidSets the field represented by this Field object on the specified instance argument to the specified new value.
Parametersinstance:* — the object whose field should be modified. This parameter may be
null if this field represents a static member.
|
|
value:* — the new value for the field of instance being modified.
|
IllegalAccessError — if this field is not writeable.
|
|
— if this field is an instance field and the supplied instance
parameter is null, if the instance parameter is not an instance of
this field declaring class, or if the supplied value cannot be converted to
this field type.
|