| Package | org.springextensions.actionscript.context.support |
| SVN browsing | FlexXMLApplicationContext.as |
| Fisheye | FlexXMLApplicationContext.as |
| Class | public class FlexXMLApplicationContext |
| Inheritance | FlexXMLApplicationContext XMLApplicationContext AbstractApplicationContext DefaultListableObjectFactory AbstractObjectFactory flash.events.EventDispatcher |
| Implements | IOwnerModuleAware, IStageProcessorRegistryAware |
XMLApplicationContext that supports flex framework specific
classes like ArrayCollection.
The context also supports special wiring for view components that happens when
display objects are added to the stage. In order to improve performance The context
use an IObjectSelector in order to decide which objects added to the stage should also
be wired and a IObjectDefinitionResolver to map stage added objects to an IObjectDefinition.
Default stage object selector implementation filters all mx.flash.package classes and objects not inheriting from UIComponent.
The IObjectDefinition is resolved using the context itself by type or name.
It is possible to configure FlexXMLApplicationContext properties to filter additional classes,
or filter by name.
It is possible to use custom IObjectSelector whether using directly the classe setter or
by creating an object having as id flexStageObjectSelector or a customer one
set with stageWireObjectSelectorName property.
It is possible to use custom stage wiring IObjectDefinitionResolver whether using directly
the classe setter or by creating an object having as id flexStageObjectDefinitionResolver
or a custom one set with stageWireObjectDefinitionResolverName property.
See also
Documentation reference: instantiating a container
| Property | Defined by | ||
|---|---|---|---|
![]() | allowObjectDefinitionOverriding : Boolean
Set whether it should be allowed to override object definitions by registering
a different definition with the same name, automatically replacing the former.
| DefaultListableObjectFactory | |
| applicationDomain : ApplicationDomain | FlexXMLApplicationContext | ||
![]() | autowireProcessor : IAutowireProcessor
| AbstractObjectFactory | |
![]() | configLocations : Array | XMLApplicationContext | |
![]() | explicitSingletonNames : Array
The names of the explicit singletons registered in this factory.
| AbstractObjectFactory | |
![]() | numObjectDefinitions : uint
The number of object definitions in this registry.
| DefaultListableObjectFactory | |
![]() | numObjectPostProcessors : int
Returns the number of object post processors.
| AbstractObjectFactory | |
![]() | objectDefinitionNames : Array
The names of the registered object definitions.
| DefaultListableObjectFactory | |
![]() | objectDefinitions : Object | AbstractObjectFactory | |
| ownerModule : Module
The
Module that will act as the owner of the current IOwnerModuleAware instance. | FlexXMLApplicationContext | ||
![]() | parent : IObjectFactory
| AbstractObjectFactory | |
![]() | parentContext : IApplicationContext
Returns the parent application context or
null if no parent is set. | AbstractApplicationContext | |
![]() | parser : XMLObjectDefinitionsParser
Contains the parser of the XML definitions.
| XMLApplicationContext | |
![]() | properties : Properties | AbstractObjectFactory | |
| stageProcessorRegistry : IStageProcessorRegistry
| FlexXMLApplicationContext | ||
![]() | typeConverter : ITypeConverter
The current type converter implementation
| AbstractObjectFactory | |
| Method | Defined by | ||
|---|---|---|---|
|
FlexXMLApplicationContext(source:* = null, ownerModule:Module = null)
Creates a new | FlexXMLApplicationContext | ||
![]() |
addConfig(config:XML):void
| XMLApplicationContext | |
![]() |
addConfigLocation(configLocation:String):void
| XMLApplicationContext | |
![]() |
addEmbeddedConfig(config:Class):void
| XMLApplicationContext | |
![]() |
addNamespaceHandler(handler:INamespaceHandler):void
Adds a namespace handler to the parser of this application context.
| XMLApplicationContext | |
![]() |
addObjectFactoryPostProcessor(objectFactoryPostProcessor:IObjectFactoryPostProcessor, index:int = -1):void
Adds an
IObjectFactoryPostProcessor instance to the current XMLApplicationContext
| AbstractApplicationContext | |
![]() |
addObjectPostProcessor(objectPostProcessor:IObjectPostProcessor):void
If the specified | AbstractObjectFactory | |
![]() |
addReferenceResolver(referenceResolver:IReferenceResolver):void
This method adds a reference resolver that will be used to resolve property
references.
| AbstractObjectFactory | |
|
addResourceBundleLocation(url:String, name:String, locale:String):void
Adds the info of an external resource bundle to the context, that will be loaded before the container
dispatches its "complete" event.
| FlexXMLApplicationContext | ||
![]() |
canCreate(objectName:String):Boolean
Determines if the object factory is able to create the object with the given name.
| AbstractObjectFactory | |
![]() |
clearObjectFromInternalCache(name:String):Object
Removes an object from the internal object definition cache.
| AbstractObjectFactory | |
![]() |
containsObject(objectName:String):Boolean
Determines if the object factory contains a definition with the given name.
| AbstractObjectFactory | |
![]() |
containsObjectDefinition(objectName:String):Boolean
Determines if an object definition with the given name exists
| DefaultListableObjectFactory | |
![]() |
createInstance(clazz:Class, constructorArguments:Array = null):*
Creates an instance of the specified
Class, wires the instance and returns it. | AbstractObjectFactory | |
|
disableStageProcessing():void
Sets the
stageProcessorRegistry.enabled property to false. | FlexXMLApplicationContext | ||
|
enableStageProcessing():void
Sets the
stageProcessorRegistry.enabled property to true. | FlexXMLApplicationContext | ||
|
getClassForInstance(object:Object):Class
| FlexXMLApplicationContext | ||
|
getClassForName(className:String):Class
| FlexXMLApplicationContext | ||
![]() |
getObject(name:String, constructorArguments:Array = null):*
Will retrieve an object by it's name/id If the definition is a singleton it will be retrieved from
cache if possible.
| AbstractObjectFactory | |
![]() |
getObjectDefinition(objectName:String):IObjectDefinition
Returns the object definition registered with the given name.
| DefaultListableObjectFactory | |
![]() |
getObjectNamesForType(type:Class):Array
Returns the names of all object definitions and explicit singletons in this factory that are of
the given type.
| DefaultListableObjectFactory | |
![]() |
getObjectsOfType(type:Class):Object
Returns all object definitions and explicit singletons that are of the given type.
| DefaultListableObjectFactory | |
![]() |
getType(objectName:String):Class
Returns the type that is defined on the object definition.
| AbstractObjectFactory | |
![]() |
isFactoryObject(objectName:String):Boolean
Determines if an object is a IFactoryObject implementation.
| AbstractObjectFactory | |
![]() |
isPrototype(objectName:String):Boolean
Determines if the definition with the given name is a prototype.
| AbstractObjectFactory | |
![]() |
isSingleton(objectName:String):Boolean
Determines if the definition with the given name is a singleton.
| AbstractObjectFactory | |
![]() |
load():void
This method will internally do the following:
| XMLApplicationContext | |
![]() |
preInstantiateSingletons():void
Checks if the objectdefinition is an implementation of | DefaultListableObjectFactory | |
![]() |
registerCustomEditor(requiredType:Class, propertyEditor:IPropertyEditor):void
Registers a custom property editor.
| AbstractObjectFactory | |
![]() |
registerObjectDefinition(objectName:String, objectDefinition:IObjectDefinition):void
Registers the given objectDefinition under the given name.
| DefaultListableObjectFactory | |
![]() |
registerSingleton(name:String, object:Object):void
| AbstractApplicationContext | |
![]() |
removeObjectDefinition(objectName:String):void
Removes the definition with the given name from the registry
| DefaultListableObjectFactory | |
![]() |
resolveReference(property:Object):Object
Resolves a property in an object definition.
| AbstractObjectFactory | |
![]() |
wire(object:*, objectDefinition:IObjectDefinition, objectName:String = null):void
| AbstractObjectFactory | |
| Method | Defined by | ||
|---|---|---|---|
|
addImportLocationsIfAny(xml:XML):void
Checks if the given xml data contains any <import/> tags. | FlexXMLApplicationContext | ||
![]() |
buildObject(name:String, constructorArguments:Array = null):*
Builds an object for the given name and returns it.
| AbstractObjectFactory | |
![]() |
cleanupLoader():void
If the
_loader variable is not null the onLoaderComplete
and onIOError event handlers are removed. | XMLApplicationContext | |
|
completeHandler(event:Event):void
Event.COMPLETE event handler added in context constructor. | FlexXMLApplicationContext | ||
![]() |
createObjectViaInstanceFactoryMethod(objectName:String, methodName:String, args:Array = null):*
| AbstractObjectFactory | |
![]() |
createObjectViaStaticFactoryMethod(clazz:Class, applicationDomain:ApplicationDomain, factoryMethodName:String, args:Array = null):*
| AbstractObjectFactory | |
![]() |
getBaseURL(url:String):String
Returns the base url of the file this loading is loading.
| XMLApplicationContext | |
|
initFlexXMLApplicationContext(ownerModule:Module):void
Initializes the
FlexXMLApplicationContext instance. | FlexXMLApplicationContext | ||
![]() |
initXMLObjectFactory(source:*):void
Initializes the
XMLObjectFactoryInit instance
| XMLApplicationContext | |
![]() |
Invokes all object factory post processors.
| AbstractApplicationContext | |
![]() |
loadComplete():void
TODO
| AbstractApplicationContext | |
![]() |
loadConfigLocation(configLocation:String):void
Will load a configLocation
| XMLApplicationContext | |
|
parse():void
Parses the xml.
| FlexXMLApplicationContext | ||
![]() |
prepareApplicationContext():void
Hook method defined in XmlObjectFactory to add the
ApplicationContextAwareProcessor. | AbstractApplicationContext | |
![]() |
Looks for implementations of IObjectFactoryPostProcessor in the object definition of this context and
add an instance of each one as a object factory post processor.
| AbstractApplicationContext | |
![]() |
registerObjectPostProcessors():void
Will search all object definitions for implementations of IObjectPostProcessor.
| AbstractApplicationContext | |
| applicationDomain | property |
applicationDomain:ApplicationDomain [read-write]Implementation
public function get applicationDomain():ApplicationDomain
public function set applicationDomain(value:ApplicationDomain):void
| ownerModule | property |
ownerModule:Module [read-write]
The Module that will act as the owner of the current IOwnerModuleAware instance.
public function get ownerModule():Module
public function set ownerModule(value:Module):void
| stageProcessorRegistry | property |
stageProcessorRegistry:IStageProcessorRegistry [read-write]Implementation
public function get stageProcessorRegistry():IStageProcessorRegistry
public function set stageProcessorRegistry(value:IStageProcessorRegistry):void
| FlexXMLApplicationContext | () | constructor |
public function FlexXMLApplicationContext(source:* = null, ownerModule:Module = null)
Creates a new FlexXMLApplicationContext.
source:* (default = null) |
|
ownerModule:Module (default = null) |
| addImportLocationsIfAny | () | method |
protected override function addImportLocationsIfAny(xml:XML):void
Checks if the given xml data contains any <import/> tags. If any are found, their corresponding xml file is added to the load queue.
If an import has an attribute of type="class" the file is not being loaded but instead
an property with the same name as the file attribute is retrieved from the current
Application, this property needs to be of type Class and must
represent an embedded resource.
xml:XML |
— When the embeddedName is not found as a property on the Application object or when this property is not of type Class.
|
| addResourceBundleLocation | () | method |
public function addResourceBundleLocation(url:String, name:String, locale:String):voidAdds the info of an external resource bundle to the context, that will be loaded before the container dispatches its "complete" event.
Once loaded, the values of the external resource bundle are parsed into a ResourceBundle instance and passed into the ResourceManager.
Parametersurl:String — the location of the external resource bundle
|
|
name:String — the name of the resource bundle
|
|
locale:String — the locale
|
| completeHandler | () | method |
protected function completeHandler(event:Event):void
Event.COMPLETE event handler added in context constructor.
Attempts to wire all the components that are already on the stage cache.
Assigns the systemManager property with the current application's systemManager
and adds the stageWireObjectHandler() method as an Event.ADDED listener on the systemManager.
event:Event — The specified Event.COMPLETE event
|
| disableStageProcessing | () | method |
public function disableStageProcessing():void
Sets the stageProcessorRegistry.enabled property to false.
Useful during testing and object dispose.
See also
| enableStageProcessing | () | method |
public function enableStageProcessing():void
Sets the stageProcessorRegistry.enabled property to true.
Useful during testing and object dispose.
See also
| getClassForInstance | () | method |
public override function getClassForInstance(object:Object):ClassParameters
object:Object |
Class |
| getClassForName | () | method |
public override function getClassForName(className:String):ClassParameters
className:String |
Class |
| initFlexXMLApplicationContext | () | method |
protected function initFlexXMLApplicationContext(ownerModule:Module):void
Initializes the FlexXMLApplicationContext instance.
ownerModule:Module |
| parse | () | method |
protected override function parse():voidParses the xml.