| Package | org.springextensions.actionscript.ioc.autowire |
| SVN browsing | DefaultAutowireProcessor.as |
| Fisheye | DefaultAutowireProcessor.as |
| Class | public class DefaultAutowireProcessor |
| Implements | IAutowireProcessor, IObjectFactoryAware |
| Subclasses | DefaultFlexAutowireProcessor |
Default IAutowireProcessor implementation used by the AbstractObjectFactory.
See also
| Property | Defined by | ||
|---|---|---|---|
| objectFactory : IObjectFactory
| DefaultAutowireProcessor | ||
| Method | Defined by | ||
|---|---|---|---|
|
DefaultAutowireProcessor(objectFactory:IObjectFactory)
Creates a new
DefaultAutowireProcessor instance. | DefaultAutowireProcessor | ||
|
autoWire(object:Object, objectDefinition:IObjectDefinition, objectName:String = null):void
Method called during object creation. | 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 of the specified
Field instance contains any autowiring metadata, abd based
on this class the appropriate wiring methods. | DefaultAutowireProcessor | ||
|
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 | ||
|
determinePrimaryCandidate(candidateNames:Array):String
| DefaultAutowireProcessor | ||
|
findAutowireCandidateName(clazz:Class):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.
| DefaultAutowireProcessor | ||
|
getUnclaimedSimpleObjectProperties(object:Object, objectDefinition:IObjectDefinition):Array
Used by autowire system in order to find fields eligible for autowire
| 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 | ||
| objectFactory | property |
objectFactory:IObjectFactory [read-write]Implementation
public function get objectFactory():IObjectFactory
public function set objectFactory(value:IObjectFactory):void
| DefaultAutowireProcessor | () | constructor |
public function DefaultAutowireProcessor(objectFactory:IObjectFactory)
Creates a new DefaultAutowireProcessor instance.
objectFactory:IObjectFactory |
| autoWire | () | method |
public function autoWire(object:Object, objectDefinition:IObjectDefinition, objectName:String = null):void
Method called during object creation. Will autowire unclaimed non simple properties by type or by name if required by the object definition.
Performs autowiring on the specified object instance, the specifiedIObjectDefinition can optionally
be used to retrieve autowiring information from.
Parameters
object:Object — The instance that needs to be autowired.
|
|
objectDefinition:IObjectDefinition — The IObjectDefinition associated with the object that needs to be created.
|
|
objectName:String (default = null) — The name of the object as it is registered in a container.
|
See also
| autoWireByName | () | method |
protected function autoWireByName(object:Object, objectDefinition:IObjectDefinition):voidCalled by autoWire method in case of autowire by name.
Parametersobject:Object |
|
objectDefinition:IObjectDefinition |
See also
| autoWireByType | () | method |
protected function autoWireByType(object:Object, objectDefinition:IObjectDefinition):voidCalled by autoWire method in case of autowire by type.
Parametersobject:Object |
|
objectDefinition:IObjectDefinition |
See also
| autoWireField | () | method |
protected function autoWireField(object:Object, field:Field, objectName:String):void
Checks of the specified Field instance contains any autowiring metadata, abd based
on this class the appropriate wiring methods.
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
|
| autoWireFieldByName | () | method |
protected function 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.
object:Object — The object being autowired
|
|
field:Field — The field that will be injected
|
|
metadata:MetaData — The autowiring metadata
|
|
objectName:String — The name of the object in the objectFactory
|
| autoWireFieldByPropertyName | () | method |
protected function 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.
object:Object — The object being autowired
|
|
field:Field — The field that will be injected
|
|
metadata:MetaData — The autowiring metadata
|
|
objectName:String — The name of the object in the objectFactory
|
| autoWireFieldByType | () | method |
protected function autoWireFieldByType(object:Object, field:Field, metadata:MetaData, objectName:String):voidTries to retrieve an autowire candidate based on the type of the specified field, and when found injects the candidate into the specified field.
Parametersobject:Object — The object being autowired
|
|
field:Field — The field that will be injected.
|
|
metadata:MetaData — The autowiring metadata
|
|
objectName:String — The name of the object in the objectFactory
|
| determinePrimaryCandidate | () | method |
protected function determinePrimaryCandidate(candidateNames:Array):StringParameters
candidateNames:Array |
String |
| findAutowireCandidateName | () | method |
protected function findAutowireCandidateName(clazz:Class):StringParameters
clazz:Class |
String |
| findAutowireCandidateNames | () | method |
protected function findAutowireCandidateNames(clazz:Class):ArrayCalled by autoWireByType to get all object names that could be used to autowire an object property
Parametersclazz:Class — The class of the property that needs to get autowired.
|
Array — an Array containing all autowire candidates names.
|
See also
| getApplicationDomain | () | method |
protected function getApplicationDomain(object:Object):ApplicationDomainReturns the application domain for the given object.
Parametersobject:Object |
ApplicationDomain |
| getUnclaimedSimpleObjectProperties | () | method |
protected function getUnclaimedSimpleObjectProperties(object:Object, objectDefinition:IObjectDefinition):ArrayUsed by autowire system in order to find fields eligible for autowire
Parametersobject:Object |
|
objectDefinition:IObjectDefinition |
Array — An array containing the names of all public variables and readwrite / writeonly
accessors.
|
| preprocessObjectDefinition | () | method |
public function preprocessObjectDefinition(objectDefinition:IObjectDefinition):void
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.
ParametersobjectDefinition:IObjectDefinition — The IObjectDefinition that describes the object that will be created.
|
See also
| AUTOWIRED_ANNOTATION | constant |
public static const AUTOWIRED_ANNOTATION:String = "Autowired"The name of the metadata that determines whether a field needs to be autowired
| AUTOWIRED_ARGUMENT_EXTERNALPROPERTY | constant |
public static const AUTOWIRED_ARGUMENT_EXTERNALPROPERTY:String = "externalProperty"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
| AUTOWIRED_ARGUMENT_MODE | constant |
public static const AUTOWIRED_ARGUMENT_MODE:String = "mode"The name of the metadata argument that determines the autowiring strategy, possibles values are 'autodetect', 'byName', 'byType', 'constructor' or 'no'
| AUTOWIRED_ARGUMENT_NAME | constant |
public static const AUTOWIRED_ARGUMENT_NAME:String = "name"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
| AUTOWIRED_ARGUMENT_REQUIRED | constant |
public static const AUTOWIRED_ARGUMENT_REQUIRED:String = "required"The name of the metadata argument that determines whether the dependency is required or not.