Package | com.asfusion.mate.actions.builders |
Class | public class PropertySetter |
Inheritance | PropertySetter ObjectBuilder BaseAction AbstractAction |
PropertySetter
will create an object of the class specified
in the generator
attribute. After that, it will set a
property in the key
attribute on the newly created object.
The value to set can be the source
object or a property of
the source object that is specified in the sourceKey
attribute.
Property | Defined by | ||
---|---|---|---|
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 | ||
registerTarget : Boolean
Registers the newly created object as an injector target.
| ObjectBuilder | ||
source : *
An object that contains the data that will be used to set the target object.
| PropertySetter | ||
sourceCache : String
The sourceCache is only useful when the source is a class.
| PropertySetter | ||
sourceKey : String
The name of the property on the source object that will be used to read
the value to be set the generated object.
| PropertySetter | ||
targetKey : String
The name of the property that will be set in the generated object.
| PropertySetter |
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 | ||
getRealObject(obj:*, scope:IScope, cache:String):*
Helper function to get the source or destination objects
from either a String value, a SmartObject or other.
| PropertySetter | ||
The first method that
trigger calls. | ObjectBuilder | ||
Where all the action occurs.
| PropertySetter | ||
setProperties(scope:IScope):void
Where all the properties are set into the
currentInstance . | BaseAction |
source | property |
source:*
[read-write]An object that contains the data that will be used to set the target object.
The default value is undefined
.
public function get source():*
public function set source(value:*):void
sourceCache | property |
sourceCache:String
[read-write]The sourceCache is only useful when the source is a class. This attribute defines which cache we will look up for a created object.
Implementation public function get sourceCache():String
public function set sourceCache(value:String):void
sourceKey | property |
sourceKey:String
[read-write]The name of the property on the source object that will be used to read the value to be set the generated object.
The default value is null
.
public function get sourceKey():String
public function set sourceKey(value:String):void
targetKey | property |
targetKey:String
[read-write]The name of the property that will be set in the generated object.
The default value is null
.
public function get targetKey():String
public function set targetKey(value:String):void
getRealObject | () | method |
protected function getRealObject(obj:*, scope:IScope, cache:String):*
Helper function to get the source or destination objects from either a String value, a SmartObject or other.
Parametersobj:* |
|
scope:IScope |
|
cache:String |
* |
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 |