Packageorg.granite.reflect
Classpublic class Member
InheritanceMember Inheritance DescribedElement
ImplementsIAnnotatedElement, IMember
SubclassesField, Parameterizable

Base class for Field, Method and Constructor classes.



Public Properties
 PropertyDefined by
  annotations : Array
[read-only] An array that contains all annotations directly attached to this IAnnotatedElement.
Member
 InheriteddeclaredBy : Type
The Type instance this described element belongs to.
DescribedElement
  name : String
[read-only] The name of this Member.
Member
  ns : Namespace
[read-only] The namespace of this Member.
Member
  propertyKey : String
[read-only] 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
[read-only] The qualified name of this Member.
Member
  uri : String
[read-only] The uri of the qualified name of this Member (members declared in namespaces) or "" if this member is public.
Member
Public Methods
 MethodDefined by
  
Member(declaredBy:Type, desc:XML)
Constructs a new Member instance.
Member
 Inherited
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.
Member
  
getAnnotations(recursive:Boolean = false, pattern:String = "^_?[^_]"):Array
Returns an array (possibly empty) that contains all annotations attached to this IAnnotatedElement.
Member
  
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.
Member
  
isConstant():Boolean
Checks if this member is a constant field.
Member
  
isConstructor():Boolean
Checks if this member is a constructor.
Member
  
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
 Inherited
toString():String
Returns the a string (XML) representation of this described element.
DescribedElement
Property detail
annotationsproperty
annotations:Array  [read-only]

An array that contains all annotations directly attached to this IAnnotatedElement.

Implementation
    public function get annotations():Array
nameproperty 
name:String  [read-only]

The name of this Member.

Implementation
    public function get name():String
nsproperty 
ns:Namespace  [read-only]

The namespace of this Member. Note that the returned namespace has a always a prefix equal to "" (describeType only returns the namespace uri).

Implementation
    public function get ns():Namespace
propertyKeyproperty 
propertyKey:String  [read-only]

The String representation of this member (field or method qName, key of a dynamic property or dictionary, index of an array, etc.)

Implementation
    public function get propertyKey():String
qNameproperty 
qName:QName  [read-only]

The qualified name of this Member.

Implementation
    public function get qName():QName
uriproperty 
uri:String  [read-only]

The uri of the qualified name of this Member (members declared in namespaces) or "" if this member is public.

Implementation
    public function get uri():String
Constructor detail
Member()constructor
public function Member(declaredBy:Type, desc:XML)

Constructs a new Member instance.

Parameters
declaredBy:Type — the Type instance this member belongs to.
 
desc:XML — the XML description of the member.
Method detail
getAnnotation()method
public 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.

Parameters
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 ?

Returns
Annotation — an Annotation instance or null if it cannot be found.
getAnnotations()method 
public function getAnnotations(recursive:Boolean = false, pattern:String = "^_?[^_]"):Array

Returns an array (possibly empty) that contains all annotations attached to this IAnnotatedElement.

Parameters
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.

Returns
Array — an array that contains all annotations attached to this IAnnotatedElement.
isAccessor()method 
public function isAccessor():Boolean

Checks if this member is an accessor (get/set) field.

Returns
Booleantrue if this member is an accessor, false otherwise.
isAnnotationPresent()method 
public 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.

Parameters
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 ?

Returns
Booleantrue if the annotation can be found, false otherwise.
isConstant()method 
public function isConstant():Boolean

Checks if this member is a constant field.

Returns
Booleantrue if this member is a constant, false otherwise.
isConstructor()method 
public function isConstructor():Boolean

Checks if this member is a constructor.

Returns
Booleantrue if this member is a constructor, false otherwise.
isDynamicProperty()method 
public function isDynamicProperty():Boolean

Checks if this member is a dynamic property (always false for Member, always true for DynamicProperty).

Returns
Booleantrue if this member is a dynamic property, false otherwise.
isInNamespace()method 
public function isInNamespace(ns:Namespace):Boolean

Tells if this Member instance is declared in the the suplied ns namespace parameter. If ns is null, this method checks if this member is in the public namespace (uri == "") or in the builtin AS3 namespace. Otherwise, it checks this member's uri and the ns's uri for equality.

Parameters
ns:Namespace — the Namespace to check for equality with this member's namespace.

Returns
Booleantrue if this member's namespace is the equal to the suplied ns parameter, false otherwise.

See also

AS3
isMethod()method 
public function isMethod():Boolean

Checks if this member is a method.

Returns
Booleantrue if this member is a method, false otherwise.
isReadable()method 
public function isReadable():Boolean

Checks if this member is readable (fields only).

Returns
Booleantrue if this member is readable, false otherwise.
isStatic()method 
public function isStatic():Boolean

Checks if this member is static.

Returns
Booleantrue if this member is static, false otherwise.
isVariable()method 
public function isVariable():Boolean

Checks if this member is a variable field.

Returns
Booleantrue if this member is a variable, false otherwise.
isWriteable()method 
public function isWriteable():Boolean

Checks if this member is writeable (fields only).

Returns
Booleantrue if this member is writeable, false otherwise.