Package | com.asfusion.mate.actions.builders |
Class | public class MethodInvoker |
Inheritance | MethodInvoker ObjectBuilder BaseAction AbstractAction |
Subclasses | AsyncMethodInvoker |
IActionList
tag and the list is executed,
MethodInvoker
will create an object of the class specified in the generator
attribute.
It will then call the function specified in the method
attribute on the newly created object.
You can pass arguments to this function that come from a variety of sources, such as the event itself,
a server result object, or any other value.
Unless you specify cache="none", this MethodInvoker
instance will be "cached" and not instantiated again.
MXML Syntax Hide MXML Syntax
The <MethodInvoker>
tag has the following tag attributes:
<MethodInvoker Properties generator="Class" constructorArgs="Object|Array" properties="Properties" arguments="Object|Array" method="String" cache="local|global|inherit|none" />
See also
Property | Defined by | ||
---|---|---|---|
arguments : *
The property
arguments allows you to pass an Object or an Array of objects when calling
the function defined in the property method . | MethodInvoker | ||
cache : String
The cache attribute lets you specify whether this newly created object should be kept live
so that the next time an instance of this class is requested, this already created object
is returned instead.
| ObjectBuilder | ||
constructorArguments : *
The constructorArgs allows you to pass an Object or an Array of objects to the contructor
when the instance is created.
| ObjectBuilder | ||
generator : Class
The generator attribute specifies what class should be instantiated.
| ObjectBuilder | ||
method : String
The function to call on the created object.
| MethodInvoker | ||
properties : ArrayProperties allows you to add properties to the currentInstance . | BaseAction | ||
registerTarget : Boolean
Registers the newly created object as an injector target.
| ObjectBuilder |
Method | Defined by | ||
---|---|---|---|
The last method that
trigger calls. | AbstractAction | ||
createInstance(scope:IScope):Object
Where the currentInstance is created using the
generator class as the template, passing arguments to the constructor
as specified by the constructorArgs (if any). | ObjectBuilder | ||
The first method that
trigger calls. | ObjectBuilder | ||
Where all the action occurs.
| MethodInvoker | ||
setProperties(scope:IScope):void
Where all the properties are set into the
currentInstance . | BaseAction |
arguments | property |
arguments:*
[read-write]
The property arguments
allows you to pass an Object or an Array of objects when calling
the function defined in the property method
.
You can use an array to pass multiple arguments or use a simple Object if the signature of the
method
has only one parameter.
The default value is undefined
.
public function get arguments():*
public function set arguments(value:*):void
method | property |
method:String
[read-write]The function to call on the created object.
The default value is null
.
public function get method():String
public function set method(value:String):void
run | () | method |
protected override function run(scope:IScope):void
Where all the action occurs. At this moment, the currentInstance
is already instantiated and all the properties are already set.
scope:IScope |