| Package | org.springextensions.actionscript.ioc.autowire |
| SVN browsing | DefaultFlexAutowireProcessor.as |
| Fisheye | DefaultFlexAutowireProcessor.as |
| Class | public class DefaultFlexAutowireProcessor |
| Inheritance | DefaultFlexAutowireProcessor DefaultAutowireProcessor |
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
Documentation reference: binding a stage component to a property of an object in the container
Sample project: stagewiring (source)
| Method | Defined by | ||
|---|---|---|---|
|
DefaultFlexAutowireProcessor(objectFactory:IObjectFactory)
Creates a new
DefaultFlexAutowireProcessor instance. | DefaultFlexAutowireProcessor | ||
![]() |
autoWire(object:Object, objectDefinition:IObjectDefinition = null, objectName:String = null):void
Method called during object creation. | DefaultAutowireProcessor | |
![]() |
findAutowireCandidateName(clazz:Class):String
| DefaultAutowireProcessor | |
![]() |
preprocessObjectDefinition(objectDefinition:IObjectDefinition):void
Performs Method that can be invoked by an Typically this method can be used to do some kind of constructor configuration. | DefaultAutowireProcessor | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
autoWireByName(object:Object, objectDefinition:IObjectDefinition):void
Called by autoWire method in case of autowire by name.
| DefaultAutowireProcessor | |
![]() |
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 Field instance contains any autowiring metadata, abd based
on this class the appropriate wiring methods. | DefaultFlexAutowireProcessor | ||
![]() |
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 | |
![]() |
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 | |
![]() |
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 | ||
![]() |
determinePrimaryCandidate(candidateNames:Array):String
| DefaultAutowireProcessor | |
![]() |
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 | ||
![]() |
getAutowiredOrInjectMetadata(field:Field):Array
| DefaultAutowireProcessor | |
![]() |
getUnclaimedSimpleObjectProperties(object:Object, objectDefinition:IObjectDefinition):Array
Used by autowire system in order to find fields eligible for autowire
| DefaultAutowireProcessor | |
![]() |
initDefaultAutowireProcessor(objectFactory:IObjectFactory):void
| DefaultAutowireProcessor | |
| Constant | Defined by | ||
|---|---|---|---|
![]() | AUTOWIRED_ANNOTATION : String = "Autowired" [static]
The name of the metadata that determines whether a field needs to be autowired
| DefaultAutowireProcessor | |
![]() | AUTOWIRED_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 | |
![]() | AUTOWIRED_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 | |
![]() | AUTOWIRED_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 | |
![]() | AUTOWIRED_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 | ||
![]() | INJECT_ANNOTATION : String = "Inject" [static]
The name of the metadata that determines whether a field needs to be autowired
| DefaultAutowireProcessor | |
| DefaultFlexAutowireProcessor | () | constructor |
public function DefaultFlexAutowireProcessor(objectFactory:IObjectFactory)
Creates a new DefaultFlexAutowireProcessor instance.
objectFactory:IObjectFactory |
| 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.
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):voidRetrieves 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.
Parametersobject: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
|
— when binding fails
|
| getApplicationDomain | () | method |
protected override function getApplicationDomain(object:Object):ApplicationDomainReturns the application domain for the given object.
Parametersobject:Object |
ApplicationDomain |
| AUTOWIRED_PROPERTY_NAME | constant |
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.