Packageorg.springextensions.actionscript.ioc.autowire
SVN browsingDefaultFlexAutowireProcessor.as
FisheyeDefaultFlexAutowireProcessor.as
Classpublic class DefaultFlexAutowireProcessor
InheritanceDefaultFlexAutowireProcessor Inheritance DefaultAutowireProcessor

Extension of the DefaultAutowireProcessor that also allows object fields to be bound to other objects.

Use this annotation syntax to use field binding in your object:

[Autowired(host="objectName","property.chain")] public var myProperty:String;

Where the objectName key is an object name in the container.

This autowire processor is created by default by the FlexXMLApplicationContext

See also

FlexXMLApplicationContext


Documentation reference: binding a stage component to a property of an object in the container

Sample project: stagewiring (source)


Public Properties
 PropertyDefined by
 InheritedobjectFactory : IObjectFactory
DefaultAutowireProcessor
Public Methods
 MethodDefined by
  
Creates a new DefaultFlexAutowireProcessor instance.
DefaultFlexAutowireProcessor
 Inherited
autoWire(object:Object, objectDefinition:IObjectDefinition = null, objectName:String = null):void

Method called during object creation.

DefaultAutowireProcessor
 Inherited
findAutowireCandidateName(clazz:Class):String
DefaultAutowireProcessor
 Inherited

Performs AUTODETECT and CONSTRUCTOR checks.

Method that can be invoked by an IObjectFactory implementation for any type of pre-processing of the IObjectDefinition associated with the object that needs to be created.

Typically this method can be used to do some kind of constructor configuration.

DefaultAutowireProcessor
Protected Methods
 MethodDefined by
 Inherited
autoWireByName(object:Object, objectDefinition:IObjectDefinition):void
Called by autoWire method in case of autowire by name.
DefaultAutowireProcessor
 Inherited
autoWireByType(object:Object, objectDefinition:IObjectDefinition):void
Called by autoWire method in case of autowire by type.
DefaultAutowireProcessor
  
autoWireField(object:Object, field:Field, objectName:String):void

Checks for the existence of a host and chain metadata argument key, if found the bindField() method is invoked.

Checks of the specified Field instance contains any autowiring metadata, abd based on this class the appropriate wiring methods.
DefaultFlexAutowireProcessor
 Inherited
autoWireFieldByName(object:Object, field:Field, metadata:MetaData, objectName:String):void
Takes the field name or the value of the AUTOWIRED_ARGUMENT_NAME metadata argument, retrieves the object with that name form the objectFactory and injects it into the specified field.
DefaultAutowireProcessor
 Inherited
autoWireFieldByPropertyName(object:Object, field:Field, metadata:MetaData, objectName:String):void
Takes the value of the AUTOWIRED_ARGUMENT_EXTERNALPROPERTY metadata argument, looks up the key in the objectFactory's Properties array and injects it into the specified field.
DefaultAutowireProcessor
 Inherited
autoWireFieldByType(object:Object, field:Field, metadata:MetaData, objectName:String):void
Tries to retrieve an autowire candidate based on the type of the specified field, and when found injects the candidate into the specified field.
DefaultAutowireProcessor
  
bindField(object:Object, field:Field, metadata:MetaData, objectName:String):void
Retrieves the values for the host and chain argument keys and uses these to create a binding between the host object and the specified object being autowired.
DefaultFlexAutowireProcessor
 Inherited
determinePrimaryCandidate(candidateNames:Array):String
DefaultAutowireProcessor
 Inherited
findAutowireCandidateNames(clazz:Class):Array
Called by autoWireByType to get all object names that could be used to autowire an object property
DefaultAutowireProcessor
  
getApplicationDomain(object:Object):ApplicationDomain
Returns the application domain for the given object.
DefaultFlexAutowireProcessor
 Inherited
getAutowiredOrInjectMetadata(field:Field):Array
DefaultAutowireProcessor
 Inherited
getUnclaimedSimpleObjectProperties(object:Object, objectDefinition:IObjectDefinition):Array
Used by autowire system in order to find fields eligible for autowire
DefaultAutowireProcessor
 Inherited
DefaultAutowireProcessor
Public Constants
 ConstantDefined by
 InheritedAUTOWIRED_ANNOTATION : String = "Autowired"
[static] The name of the metadata that determines whether a field needs to be autowired
DefaultAutowireProcessor
 InheritedAUTOWIRED_ARGUMENT_EXTERNALPROPERTY : String = "externalProperty"
[static] The name of the metadata argument that determines the name of a property in the container that needs to be injected into the specified field
DefaultAutowireProcessor
 InheritedAUTOWIRED_ARGUMENT_MODE : String = "mode"
[static] The name of the metadata argument that determines the autowiring strategy, possibles values are 'autodetect', 'byName', 'byType', 'constructor' or 'no'
DefaultAutowireProcessor
 InheritedAUTOWIRED_ARGUMENT_NAME : String = "name"
[static] The name of the metadata argument that determines the name of the object in the container that needs to be injected into the specified field
DefaultAutowireProcessor
 InheritedAUTOWIRED_ARGUMENT_REQUIRED : String = "required"
[static] The name of the metadata argument that determines whether the dependency is required or not.
DefaultAutowireProcessor
  AUTOWIRED_PROPERTY_NAME : String = "property"
[static] Metadata argument key used for bindings, the value of this key determines the host object's property chain.
DefaultFlexAutowireProcessor
 InheritedINJECT_ANNOTATION : String = "Inject"
[static] The name of the metadata that determines whether a field needs to be autowired
DefaultAutowireProcessor
Constructor detail
DefaultFlexAutowireProcessor()constructor
public function DefaultFlexAutowireProcessor(objectFactory:IObjectFactory)

Creates a new DefaultFlexAutowireProcessor instance.

Parameters
objectFactory:IObjectFactory
Method detail
autoWireField()method
protected override function autoWireField(object:Object, field:Field, objectName:String):void

Checks for the existence of a host and chain metadata argument key, if found the bindField() method is invoked.

Checks of the specified Field instance contains any autowiring metadata, abd based on this class the appropriate wiring methods. Parameters
object:Object — The object being autowired
 
field:Field — The field that will be examined for the necessary metadata
 
objectName:String — The name of the object in the objectFactory
bindField()method 
protected function bindField(object:Object, field:Field, metadata:MetaData, objectName:String):void

Retrieves the values for the host and chain argument keys and uses these to create a binding between the host object and the specified object being autowired.

Parameters
object:Object — The object that is being autowired
 
field:Field — The field that will receive the binding
 
metadata:MetaData — The metadata describing the binding
 
objectName:String — The name of the object as known by the container

Throws
— when binding fails
getApplicationDomain()method 
protected override function getApplicationDomain(object:Object):ApplicationDomain

Returns the application domain for the given object.

Parameters
object:Object

Returns
ApplicationDomain
Constant detail
AUTOWIRED_PROPERTY_NAMEconstant
public static const AUTOWIRED_PROPERTY_NAME:String = "property"

Metadata argument key used for bindings, the value of this key determines the host object's property chain.