| Package | org.springextensions.actionscript.context.support.mxml |
| SVN browsing | MXMLApplicationContext.as |
| Fisheye | MXMLApplicationContext.as |
| Class | public class MXMLApplicationContext |
| Inheritance | MXMLApplicationContext FlexXMLApplicationContext XMLApplicationContext XMLObjectFactory DefaultListableObjectFactory AbstractObjectFactory flash.events.EventDispatcher |
| Implements | mx.core.IMXMLObject |
FlexXMLApplicationContext that enables configuration to be
defined in MXML instead of an external XML file.
Default MXML PropertydefinitionsList
<sas:MXMLApplicationContext id="applicationContext">
<sas:ObjectDefinition id="amfChannel" class="mx.messaging.channels.AMFChannel">
<sas:ConstructorArg value="amfChannel"/>
<sas:ConstructorArg value="http://\{server.name\}:\{server.port\}/flex2gateway/"/>
<sas:Property name="pollingEnabled" value="false"/>
<sas:Property name="id" value="amfChannel"/>
</sas:ObjectDefinition>
<sas:ObjectDefinition id="channelset" clazz="{mx.messaging.ChannelSet}">
<sas:MethodInvocation name="addChannel">
<arg ref="{amfChannel}"/>
</sas:MethodInvocation>
</sas:ObjectDefinition>
<sas:Template id="remoteObject">
<sas:ObjectDefinition clazz="{mx.rpc.remoting.mxml.RemoteObject}">
<sas:Property name="destination" value="ColdFusion"/>
<sas:Property name="concurrency" value="multiple"/>
<sas:Property name="makeObjectsBindable" value="false"/>
<sas:Property name="showBusyCursor" value="true"/>
<sas:Property name="source" value="com.serverside.remote.$#serviceClass#"/>
<sas:Property name="channelSet" ref={channelSet}>
</property>
</sas:ObjectDefinition>
</sas:Template>
<sas:ObjectDefinition id="templatedRemoteObject" template="{remoteObject}">
<sas:Param name="serviceClass" value="remotegateway"/>
</sas:ObjectDefinition>
</sas:MXMLApplicationContext>
Documentation reference: composing mxml based configuration metadata
| 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 | |
| autoInit : Boolean True if the When set to false the | MXMLApplicationContext | ||
![]() | autowireProcessor : IAutowireProcessor
| AbstractObjectFactory | |
| configLocation : String
The location of the configuration file that the
MXMLApplicationContext needs
to load after initialization. | MXMLApplicationContext | ||
| configLocations : Array [write-only]
| MXMLApplicationContext | ||
![]() | defaultAutowiringStageProcessorName : String
The name of an
IStageProcessor instance in the configuration that will override the
default autowiring stage processor created by the current instance. | FlexXMLApplicationContext | |
| definitionsList : Array
An Array of
ObjectDefinitions that have been added to this MXMLApplicationContext. | MXMLApplicationContext | ||
| interfaces : Array
An Array of
Interfaces that have been added to this MXMLApplicationContext. | MXMLApplicationContext | ||
![]() | loadedProperties : Array
An Array of
Properties instances that represent all the loaded property file. | XMLObjectFactory | |
![]() | numObjectDefinitions : int
Returns the number of definitions present in the object definition registry
| DefaultListableObjectFactory | |
![]() | numObjectPostProcessors : int
Returns the number of object post processors.
| AbstractObjectFactory | |
![]() | objectDefinitionNames : Array
Returns an array containing all object definition names.
| DefaultListableObjectFactory | |
![]() | objectDefinitions : Object | AbstractObjectFactory | |
![]() | parser : XMLObjectDefinitionsParser
Contains the parser of the XML definitions.
| XMLObjectFactory | |
| templates : Array
An Array of
Templates that have been added to this MXMLApplicationContext. | MXMLApplicationContext | ||
![]() | typeConverter : ITypeConverter
The current type converter implementation
| AbstractObjectFactory | |
| Method | Defined by | ||
|---|---|---|---|
|
MXMLApplicationContext(source:* = null)
Creates a new
MXMLApplicationContext instance
| MXMLApplicationContext | ||
![]() |
addConfig(config:XML):void
Use this method to add xml versions of configurations
| XMLObjectFactory | |
![]() |
addConfigLocation(configLocation:String):void
Use this method to add aditional configuration locations.
| XMLObjectFactory | |
![]() |
addEmbeddedConfig(config:Class):void
Adds an embedded config.
| XMLObjectFactory | |
![]() |
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
| XMLApplicationContext | |
![]() |
addObjectPostProcessor(objectPostProcessor:IObjectPostProcessor):void
Adds an object postprocessor to this object factory.
| AbstractObjectFactory | |
![]() |
addReferenceResolver(referenceResolver:IReferenceResolver):void
This method adds a reference resolver that will be used to resolve property
references.
| 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 | |
![]() |
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 associated with the given object name.
| DefaultListableObjectFactory | |
![]() |
getObjectNamesForType(type:Class):Array
Returns all object definitions names that implement the given type.
| DefaultListableObjectFactory | |
![]() |
getObjectsOfType(type:Class):Dictionary
Returns all object definitions that implement the given type.
| DefaultListableObjectFactory | |
![]() |
getType(objectName:String):Class
Returns the type that is defined on the object definition.
| AbstractObjectFactory | |
|
initialized(document:Object, id:String):void
| MXMLApplicationContext | ||
![]() |
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
Processes the
ObjectDefinitions, Templates and Interfaces that were added to the current MXMLApplicationContext,
configures ObjectDefinitions based on their Template or parent definitions. | MXMLApplicationContext | ||
![]() |
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 with the given name.
| DefaultListableObjectFactory | |
![]() |
registerStageProcessor(name:String, stageProcessor:IStageProcessor):void
Adds the specified
IStageProcessor instance to the collection. | FlexXMLApplicationContext | |
![]() |
removeObjectDefinition(objectName:String):void
Removes the definition with the given name from the registry
| DefaultListableObjectFactory | |
![]() |
removeStageWireListener():void
Remove systemManager
Event.ADDED listener added during object construction. | FlexXMLApplicationContext | |
![]() |
resolveReference(property:Object):Object
Resolves a property in an object definition.
| AbstractObjectFactory | |
![]() |
unregisterStageProcessor(name:String):void
Removes the
IStageProcessor with the specified name. | FlexXMLApplicationContext | |
![]() |
wire(object:*, objectDefinition:IObjectDefinition, objectName:String = null):void
| AbstractObjectFactory | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
addImportLocationsIfAny(xml:XML):void
Checks if the given xml data contains any | FlexXMLApplicationContext | |
![]() |
afterParse():void
Hook method defined in XmlObjectFactory overridden to invoke
application context specific logic.
| XMLApplicationContext | |
![]() |
beforeParse():void
Hook method defined in XmlObjectFactory to add the
ApplicationContextAwareProcessor. | XMLApplicationContext | |
![]() |
cleanupLoader():void
If the
_loader variable is not null the onLoaderComplete
and onIOError event handlers are removed. | XMLObjectFactory | |
![]() |
completeHandler(event:Event):void
Event.COMPLETE event handler added in context constructor. | FlexXMLApplicationContext | |
![]() |
Initializes the
FlexXMLApplicationContext instance. | FlexXMLApplicationContext | |
![]() |
getBaseURL(url:String):String
Returns the base url of the file this loading is loading.
| XMLObjectFactory | |
|
getInterface(intfClass:Class):Interface
| MXMLApplicationContext | ||
|
True if the specified
ObjectDefinition already contains a definition for the specified method. | MXMLApplicationContext | ||
|
hasProperty(objectDefinition:ObjectDefinition, propertyName:String):Boolean
True if the specified
ObjectDefinition already contains a definition for the specified property. | MXMLApplicationContext | ||
|
initializeContext():void
Invokes the
load() method if autoInit is set to true. | MXMLApplicationContext | ||
![]() |
Invokes all object factory post processors.
| XMLApplicationContext | |
![]() |
loadConfigLocation(configLocation:String):void
Will load a configLocation
| XMLObjectFactory | |
|
mergeDefinitionCollections(sourceDefinition:ObjectDefinition, destinationDefinition:ObjectDefinition):void
Copies the This will not override already existing methods or properties in the destination definition. | MXMLApplicationContext | ||
|
mergeObjectDefinitions(sourceDefinition:ObjectDefinition, destinationDefinition:ObjectDefinition):void
Copies all the properties on from the source definition to the destination definition.
| MXMLApplicationContext | ||
![]() |
processDisplayObject(dp:DisplayObject):void
Sends the specified
DisplayObject instance to the processWireCandidate() method,
then loops through its children and recursively sends those to the processDisplayObject() method. | FlexXMLApplicationContext | |
![]() |
processInterceptionCandidate(interceptionCandidate:Object):void
Detects whether an object added to the stage is a candidate for interception through
the list of
StageProcessorRegistration instances, if any IObjectSelector
approves of the object its associated IStageProcessor's process() method is invoked. | FlexXMLApplicationContext | |
| MXMLApplicationContext | |||
|
processInterfacesData(objectDefinition:ObjectDefinition):void
| MXMLApplicationContext | ||
|
processObjectDefinition(objectDefinition:ObjectDefinition):void
Optionally configures the specified
ObjectDefinition with its assigned Template or parent definition,
after which the IObjectDefinition gets registered in the superclass. | MXMLApplicationContext | ||
|
processParentData(objectDefinition:ObjectDefinition):void
Configures the specified
ObjectDefinition with its parent definition if the the parentObject property is not null. | MXMLApplicationContext | ||
|
processTemplateData(objectDefinition:ObjectDefinition):void
Processes and copies the
Template's method and property definition lists and merges the Template's
ObjectDefinition with the specified ObjectDefinition. | MXMLApplicationContext | ||
![]() |
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.
| XMLApplicationContext | |
![]() |
registerObjectPostProcessors():void
Will search all object definitions for implementations of IObjectPostProcessor.
| XMLApplicationContext | |
|
replaceArgParams(arg:Arg, params:Dictionary):void
Replaces the
Param values in the Arg's value property. | MXMLApplicationContext | ||
|
Replaces the
Param values in the MethodInvocation's name property and Arg collection. | MXMLApplicationContext | ||
|
replacePropertyParams(propertyName:String, propertyValue:Object, params:Dictionary):Property
Replaces the
Param values in the Property's name and value property. | MXMLApplicationContext | ||
![]() |
stageWireObjectHandler(event:Event):void
Stage add object event handler added in context constructor.
| FlexXMLApplicationContext | |
![]() |
wireStage():void
Loops through the all the stage components that are currently on the stage and passes them to
to the
processDisplayObject() method. | FlexXMLApplicationContext | |
![]() |
XMLObjectFactoryInit(source:*):void
Initializes the
XMLObjectFactoryInit instance
| XMLObjectFactory | |
| autoInit | property |
autoInit:Boolean [read-write]
True if the MXMLApplicationContext should start registering its ObjectDefinitions immeditiately after being created.
When set to false the load() method can be invoked manually to get the context ready for use.
public function get autoInit():Boolean
public function set autoInit(value:Boolean):void
See also
| configLocation | property |
configLocation:String [read-write]
The location of the configuration file that the MXMLApplicationContext needs
to load after initialization. Note: setting this property will clear the configLocations property first
and then adds the specified config location.
public function get configLocation():String
public function set configLocation(value:String):void
| configLocations | property |
configLocations:Array [write-only]Implementation
public function set configLocations(value:Array):void
| definitionsList | property |
definitionsList:Array [read-write]
An Array of ObjectDefinitions that have been added to this MXMLApplicationContext.
public function get definitionsList():Array
public function set definitionsList(value:Array):void
See also
| interfaces | property |
interfaces:Array [read-write]
An Array of Interfaces that have been added to this MXMLApplicationContext.
public function get interfaces():Array
public function set interfaces(value:Array):void
See also
| templates | property |
templates:Array [read-write]
An Array of Templates that have been added to this MXMLApplicationContext.
public function get templates():Array
public function set templates(value:Array):void
See also
| MXMLApplicationContext | () | constructor |
public function MXMLApplicationContext(source:* = null)
Creates a new MXMLApplicationContext instance
source:* (default = null) |
| getInterface | () | method |
protected function getInterface(intfClass:Class):InterfaceParameters
intfClass:Class |
Interface |
| hasMethod | () | method |
protected function hasMethod(objectDefinition:ObjectDefinition, method:MethodInvocation):Boolean
True if the specified ObjectDefinition already contains a definition for the specified method.
objectDefinition:ObjectDefinition |
|
method:MethodInvocation |
Boolean |
| hasProperty | () | method |
protected function hasProperty(objectDefinition:ObjectDefinition, propertyName:String):Boolean
True if the specified ObjectDefinition already contains a definition for the specified property.
objectDefinition:ObjectDefinition |
|
propertyName:String |
Boolean |
| initializeContext | () | method |
protected function initializeContext():void
Invokes the load() method if autoInit is set to true.
See also
| initialized | () | method |
public function initialized(document:Object, id:String):voidParameters
document:Object |
|
id:String |
| load | () | method |
public override function load():void
Processes the ObjectDefinitions, Templates and Interfaces that were added to the current MXMLApplicationContext,
configures ObjectDefinitions based on their Template or parent definitions. After this function the MXMLApplicationContext is ready to be used.
See also
| mergeDefinitionCollections | () | method |
protected function mergeDefinitionCollections(sourceDefinition:ObjectDefinition, destinationDefinition:ObjectDefinition):void
Copies the MethodInvocation and Property arrays of the source definition to the destination definition.
This will not override already existing methods or properties in the destination definition.
ParameterssourceDefinition:ObjectDefinition — The ObjectDefinition instance whose method and property definitions should be copied.
|
|
destinationDefinition:ObjectDefinition — The ObjectDefinition instance who will receive the copied method and property definitions.
|
| mergeObjectDefinitions | () | method |
protected function mergeObjectDefinitions(sourceDefinition:ObjectDefinition, destinationDefinition:ObjectDefinition):void
Copies all the properties on from the source definition to the destination definition. But only if these properties
have not been definied in the MXML markup of the destination definition. The dependsOn property is an array and
will be concatenated, so the destination will have both its own and its source dependencies.
sourceDefinition:ObjectDefinition — The ObjectDefinition instance whose direct properties should be copied.
|
|
destinationDefinition:ObjectDefinition — The ObjectDefinition instance who will receive the copied properties.
|
| processInterfaceData | () | method |
protected function processInterfaceData(intf:Interface, objectDefinition:ObjectDefinition):voidParameters
intf:Interface |
|
objectDefinition:ObjectDefinition |
| processInterfacesData | () | method |
protected function processInterfacesData(objectDefinition:ObjectDefinition):voidParameters
objectDefinition:ObjectDefinition |
| processObjectDefinition | () | method |
protected function processObjectDefinition(objectDefinition:ObjectDefinition):void
Optionally configures the specified ObjectDefinition with its assigned Template or parent definition,
after which the IObjectDefinition gets registered in the superclass.
objectDefinition:ObjectDefinition |
See also
| processParentData | () | method |
protected function processParentData(objectDefinition:ObjectDefinition):void
Configures the specified ObjectDefinition with its parent definition if the the parentObject property is not null.
objectDefinition:ObjectDefinition |
| processTemplateData | () | method |
protected function processTemplateData(objectDefinition:ObjectDefinition):void
Processes and copies the Template's method and property definition lists and merges the Template's
ObjectDefinition with the specified ObjectDefinition.
objectDefinition:ObjectDefinition — The ObjectDefinition that will be configured with its assigned Template instance.
|
| replaceArgParams | () | method |
protected function replaceArgParams(arg:Arg, params:Dictionary):void
Replaces the Param values in the Arg's value property.
arg:Arg |
|
params:Dictionary |
| replaceMethodParams | () | method |
protected function replaceMethodParams(method:MethodInvocation, params:Dictionary):MethodInvocation
Replaces the Param values in the MethodInvocation's name property and Arg collection.
method:MethodInvocation |
|
params:Dictionary |
MethodInvocation |
| replacePropertyParams | () | method |
protected function replacePropertyParams(propertyName:String, propertyValue:Object, params:Dictionary):Property
Replaces the Param values in the Property's name and value property.
propertyName:String |
|
propertyValue:Object |
|
params:Dictionary |
Property |