| Package | org.granite.reflect |
| Class | public class Constructor |
| Inheritance | Constructor Parameterizable Member DescribedElement |
Type.
Note: even if this class implements the IAnnotatedElement interface,
annotations are not supported on ActionScript 3 constructors (language limitation)
or not returned by flash.utils.describeType calls (reflection API limitation).
All IAnnotatedElement methods will return empty, null or false results.
| 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 constructor (always equal to the unqualified class name)
| Constructor | ||
![]() | ns : Namespace
The namespace of this
Member. | Member | |
![]() | parameters : Array
An array that contains all the parameters of this
Parameterizable
instance. | Parameterizable | |
![]() | 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 | |
| uri : String [read-only]
The uri of this constructor (always "" because constructors cannot
use specific namespaces).
| Constructor | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructor(declaredBy:Type, desc:XML)
Constructs a new
Constructor instance. | Constructor | ||
|
equals(o:*):Boolean
| Constructor | ||
![]() |
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 | |
![]() |
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 | |
|
newInstance(... args):*
Returns a new instance of this constructor's declaring class.
| Constructor | ||
|
newInstanceWithArray(args:Array):*
Returns a new instance of this constructor's declaring class.
| Constructor | ||
![]() |
toString():String
Returns the a string (XML) representation of this described element.
| DescribedElement | |
| name | property |
name:String [read-only]The name of this constructor (always equal to the unqualified class name)
Implementation public function get name():String
| uri | property |
uri:String [read-only]The uri of this constructor (always "" because constructors cannot use specific namespaces).
Implementation public function get uri():String
| Constructor | () | constructor |
public function Constructor(declaredBy:Type, desc:XML)
Constructs a new Constructor instance.
declaredBy:Type — the Type instance this constructor belongs to.
|
|
desc:XML — the XML description of the constructor.
|
| equals | () | method |
public override function equals(o:*):BooleanParameters
o:* |
Boolean |
| newInstance | () | method |
public function newInstance(... args):*Returns a new instance of this constructor's declaring class.
This is just a utility method, limited to 10 maximum arguments. It may be simpler and more powerful to call directly the constructor the following way:
var myInstance:MyClass = new myType.getClass()(...);
... args — a variable list of arguments to pass to the constructor call.
|
* — the new instance of this constructor's declaring class.
|
— if supplied arguments are not fulfilling the class
constructor requirements (count or type) or if an array of more than 10 arguments
is passed to this method.
|
|
InvocationTargetError — if the constructor has thrown an
error.
|
| newInstanceWithArray | () | method |
public function newInstanceWithArray(args:Array):*Returns a new instance of this constructor's declaring class.
This is just a utility method, limited to 10 maximum arguments. It may be simpler and more powerful to call directly the constructor the following way:
var myInstance:MyClass = new myType.getClass()(...);
args:Array — an array of arguments to pass to the constructor call.
|
* — the new instance of this constructor's declaring class.
|
— if supplied arguments are not fulfilling the class
constructor requirements (count or type) or if an array of more than 10 arguments
is passed to this method.
|
|
InvocationTargetError — if the constructor has thrown an
error.
|