| Package | org.granite.reflect |
| Class | public class Method |
| Inheritance | Method Parameterizable Member DescribedElement |
| 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 method.
| Method | ||
![]() | 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 | |
| returnType : Type
[read-only]
The returned type of this method (may be
Type.VOID or
Type.WILD. | Method | ||
| uri : String [read-only]
The namespace's uri of this method ("" for public methods).
| Method | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructs a new
Method instance. | Method | ||
![]() |
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. | Method | ||
|
getAnnotations(recursive:Boolean = false, pattern:String = "^_?[^_]"):Array
Returns an array (possibly empty) that contains all annotations attached to this
IAnnotatedElement. | Method | ||
|
invoke(instance:Object, ... args):*
Invokes the underlying method represented by this
Method object, on the
specified instance with the specified parameters. | Method | ||
|
invokeWithArray(instance:Object, args:Array):*
Invokes the underlying method represented by this
Method object, on the
specified instance with the specified parameters. | Method | ||
![]() |
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. | Method | ||
![]() |
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 | |
![]() |
toString():String
Returns the a string (XML) representation of this described element.
| DescribedElement | |
| name | property |
name:String [read-only]The name of this method.
Implementation public function get name():String
| returnType | property |
returnType:Type [read-only]
The returned type of this method (may be Type.VOID or
Type.WILD.
public function get returnType():Type
See also
| uri | property |
uri:String [read-only]The namespace's uri of this method ("" for public methods).
Implementation public function get uri():String
| Method | () | constructor |
public function Method(declaredBy:Type, desc:XML)
Constructs a new Method instance.
The declaredBy parameter is adjusted in order to match the actual type that
declares this method by using "declaredBy" attribute of its XML description.
Hence, the returned value of the Method.declaredBy
accessor may not return the declaredBy parameter value, but one of its
superclasses.
declaredBy:Type — the Type instance this method belongs to.
|
|
desc:XML — the XML description of the method.
|
| 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.
|
| invoke | () | method |
public function invoke(instance:Object, ... args):*
Invokes the underlying method represented by this Method object, on the
specified instance with the specified parameters.
instance:Object — the object the underlying method is invoked from (may be null
for static methods).
|
|
... args — a variable list of arguments used for the method call.
|
* — the result of this method call or undefined undefined if the
underlying method return type is void.
|
— if the instance parameter is not an instance of the class that
declares this method, if the method is not static and the instance parameter is
null, and whenever supplied argument count or types are not suitable.
|
|
InvocationTargetError — if the underlying function throws
an error.
|
| invokeWithArray | () | method |
public function invokeWithArray(instance:Object, args:Array):*
Invokes the underlying method represented by this Method object, on the
specified instance with the specified parameters.
instance:Object — the object the underlying method is invoked from (may be null
for static methods).
|
|
args:Array — an array of arguments used for the method call.
|
* — the result of this method call or undefined undefined if the
underlying method return type is void.
|
— if the instance parameter is not an instance of the class that
declares this method, if the method is not static and the instance parameter is
null, and whenever supplied argument count or types are not suitable.
|
|
InvocationTargetError — if the underlying function throws
an error.
|
| 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.
|