Packagecom.asfusion.mate.actions
Classpublic class PropertyInjector
InheritancePropertyInjector Inheritance AbstractAction
ImplementsIAction

PropertyInjector sets a value from an object (source) to a destination (target). If the source key is bindable, the PropertyInjector will bind the source to the targetKey. Otherwise, it will only set the property once.



Public Properties
 PropertyDefined by
  softBinding : Boolean
Flag that will be used to define the type of binding used by the PropertyInjector tag.
PropertyInjector
  source : *
An object that contains the data that the injector will use to set the target object
PropertyInjector
  sourceCache : String
If the source is a class we will try to get an instance of that class from the cache.
PropertyInjector
  sourceKey : String
The name of the property on the source object that the injector will use to read and set on the target object
PropertyInjector
  targetId : String
This tag will run if any of the following statements is true: If the targetId is null.
PropertyInjector
  targetKey : String
The name of the property that the injector will set in the target object
PropertyInjector
Protected Properties
 PropertyDefined by
 InheritedcurrentInstance : * = null
The currentInstance is the Object that this class will use and modify to do its work.
AbstractAction
 Inheriteddocument : Object
A reference to the document object associated with the IActionList that contains this action item.
AbstractAction
Public Methods
 MethodDefined by
 Inherited
initialized(document:Object, id:String):void
Called automatically by the MXML compiler if the AbstractAction is set up by using a tag.
AbstractAction
 Inherited
trigger(scope:IScope):void
This method gets called when the IActionList (ex: EventHandlers) is running.
AbstractAction
Protected Methods
 MethodDefined by
 Inherited
complete(scope:IScope):void
The last method that trigger calls.
AbstractAction
  
createInstance(scope:IScope):Object
Creates an instance of the source class.
PropertyInjector
  
prepare(scope:IScope):void
The first method that trigger calls.
PropertyInjector
  
run(scope:IScope):void
Where all the action occurs.
PropertyInjector
 Inherited
setProperties(scope:IScope):void
Where all the properties are set into the currentInstance.
AbstractAction
Property detail
softBindingproperty
softBinding:Boolean  [read-write]

Flag that will be used to define the type of binding used by the PropertyInjector tag. If softBinding is true, it will use weak references in the binding. Default value is false

The default value is false.

Implementation
    public function get softBinding():Boolean
    public function set softBinding(value:Boolean):void
sourceproperty 
source:*  [read-write]

An object that contains the data that the injector will use to set the target object

The default value is null.

Implementation
    public function get source():*
    public function set source(value:*):void
sourceCacheproperty 
sourceCache:String  [read-write]

If the source is a class we will try to get an instance of that class from the cache. This property defines whether the cache is local, global, or inherit.

The default value is inherit.

Implementation
    public function get sourceCache():String
    public function set sourceCache(value:String):void
sourceKeyproperty 
sourceKey:String  [read-write]

The name of the property on the source object that the injector will use to read and set on the target object

The default value is null.

Implementation
    public function get sourceKey():String
    public function set sourceKey(value:String):void
targetIdproperty 
targetId:String  [read-write]

This tag will run if any of the following statements is true: If the targetId is null. If the id of the target matches the targetId. Note:Target is the instance of the target class.

The default value is null.

Implementation
    public function get targetId():String
    public function set targetId(value:String):void
targetKeyproperty 
targetKey:String  [read-write]

The name of the property that the injector will set in the target object

The default value is null.

Implementation
    public function get targetKey():String
    public function set targetKey(value:String):void
Method detail
createInstance()method
protected function createInstance(scope:IScope):Object

Creates an instance of the source class.

Parameters
scope:IScope

Returns
Object
prepare()method 
protected override function prepare(scope:IScope):void

The first method that trigger calls. Usually, this is where the currentInstance is created or set if needed. In this method you can also perform any code that must be done first.

Parameters
scope:IScope
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.

Parameters
scope:IScope