Packageorg.springextensions.actionscript.ioc.factory.xml
SVN browsingXMLObjectFactory.as
FisheyeXMLObjectFactory.as
Classpublic class XMLObjectFactory
InheritanceXMLObjectFactory Inheritance DefaultListableObjectFactory Inheritance AbstractObjectFactory Inheritance flash.events.EventDispatcher
ImplementsIXMLObjectFactory
SubclassesXMLApplicationContext

Manages object definitions and creates new objects based on those definitions.



Public Properties
 PropertyDefined by
 InheritedallowObjectDefinitionOverriding : 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
 InheritedautowireProcessor : IAutowireProcessor
AbstractObjectFactory
  configLocations : Array
[read-only] Returns an array of configuration locations.
XMLObjectFactory
  loadedProperties : Array
[read-only] An Array of Properties instances that represent all the loaded property file.
XMLObjectFactory
 InheritednumObjectDefinitions : int
Returns the number of definitions present in the object definition registry
DefaultListableObjectFactory
 InheritednumObjectPostProcessors : int
Returns the number of object post processors.
AbstractObjectFactory
 InheritedobjectDefinitionNames : Array
Returns an array containing all object definition names.
DefaultListableObjectFactory
 InheritedobjectDefinitions : Object
AbstractObjectFactory
  parser : XMLObjectDefinitionsParser
Contains the parser of the XML definitions.
XMLObjectFactory
 InheritedtypeConverter : ITypeConverter
The current type converter implementation
AbstractObjectFactory
Protected Properties
 PropertyDefined by
  currentConfigLocation : String = ""
XMLObjectFactory
 InheritedearlySingletonCache : Object
Cache of early cached singletons for circular references
AbstractObjectFactory
 InheritedobjectPostProcessors : Array
Object post processors to apply when creating objects
AbstractObjectFactory
 InheritedreferenceResolvers : Array
Reference resolvers used when creating objects
AbstractObjectFactory
 InheritedsingletonCache : Object
Cache of created singleton objects
AbstractObjectFactory
Public Methods
 MethodDefined by
  
XMLObjectFactory(source:* = null)
Creates a new XmlObjectFactory
XMLObjectFactory
  
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
 Inherited
addObjectPostProcessor(objectPostProcessor:IObjectPostProcessor):void
Adds an object postprocessor to this object factory.
AbstractObjectFactory
 Inherited
addReferenceResolver(referenceResolver:IReferenceResolver):void
This method adds a reference resolver that will be used to resolve property references.
AbstractObjectFactory
 Inherited
clearObjectFromInternalCache(name:String):Object
Removes an object from the internal object definition cache.
AbstractObjectFactory
 Inherited
containsObject(objectName:String):Boolean
Determines if the object factory contains a definition with the given name.
AbstractObjectFactory
 Inherited
containsObjectDefinition(objectName:String):Boolean
Determines if an object definition with the given name exists
DefaultListableObjectFactory
 Inherited
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
 Inherited
Returns the object definition associated with the given object name.
DefaultListableObjectFactory
 Inherited
getObjectNamesForType(type:Class):Array
Returns all object definitions names that implement the given type.
DefaultListableObjectFactory
 Inherited
getObjectsOfType(type:Class):Dictionary
Returns all object definitions that implement the given type.
DefaultListableObjectFactory
 Inherited
getType(objectName:String):Class
Returns the type that is defined on the object definition.
AbstractObjectFactory
 Inherited
isFactoryObject(objectName:String):Boolean
Determines if an object is a IFactoryObject implementation.
AbstractObjectFactory
 Inherited
isPrototype(objectName:String):Boolean
Determines if the definition with the given name is a prototype.
AbstractObjectFactory
 Inherited
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:
  • Load all configuration entries (if any)
  • Load all imports (if any)
  • Load all property files (if any)
  • Give the resuls to the XMLObjectDefinitionsParser
Instructs the object factory to start loading the available configuration(s)
XMLObjectFactory
 Inherited

Checks if the objectdefinition is an implementation of IFactoryObject, if so the factory will be pre-instantiated, not the result of the factory.

Instantiates all definitions that are defined as singleton and are not lazy.
DefaultListableObjectFactory
 Inherited
registerCustomEditor(requiredType:Class, propertyEditor:IPropertyEditor):void
Registers a custom property editor.
AbstractObjectFactory
 Inherited
registerObjectDefinition(objectName:String, objectDefinition:IObjectDefinition):void
Registers the given objectDefinition with the given name.
DefaultListableObjectFactory
 Inherited
removeObjectDefinition(objectName:String):void
Removes the definition with the given name from the registry
DefaultListableObjectFactory
 Inherited
resolveReference(property:Object):Object
Resolves a property in an object definition.
AbstractObjectFactory
 Inherited
wire(object:*, objectDefinition:IObjectDefinition, objectName:String = null):void
AbstractObjectFactory
Protected Methods
 MethodDefined by
  
Checks if the given xml data contains any tags.
XMLObjectFactory
  
afterParse():void
Hook method, executed after the xml context is parsed.
XMLObjectFactory
  
beforeParse():void
Hook method, executed before the xml context is parsed.
XMLObjectFactory
  
If the _loader variable is not null the onLoaderComplete and onIOError event handlers are removed.
XMLObjectFactory
  
getBaseURL(url:String):String
Returns the base url of the file this loading is loading.
XMLObjectFactory
  
loadConfigLocation(configLocation:String):void
Will load a configLocation
XMLObjectFactory
  
XMLObjectFactoryInit(source:*):void
Initializes the XMLObjectFactoryInit instance
XMLObjectFactory
Events
 EventSummaryDefined by
   Dispatched as a result of a call to the load method when all available configurations have been parsed.XMLObjectFactory
   Dispatched when an input or output error occurs that causes a load operation to fail.XMLObjectFactory
Public Constants
 ConstantDefined by
 InheritedOBJECT_FACTORY_PREFIX : String = "&"
[static] Used to dereference an IFactoryObject instance and distinguish it from objects created by the IFactoryObject.
AbstractObjectFactory
Property detail
configLocationsproperty
configLocations:Array  [read-only]

Returns an array of configuration locations.

Implementation
    public function get configLocations():Array
currentConfigLocationproperty 
protected var currentConfigLocation:String = ""
loadedPropertiesproperty 
loadedProperties:Array  [read-only]

An Array of Properties instances that represent all the loaded property file.

Implementation
    public function get loadedProperties():Array
parserproperty 
public var parser:XMLObjectDefinitionsParser

Contains the parser of the XML definitions. The instance is created in the constructor if it does not exist allready.

The default value is an instance of XMLObjectDefinitionsParser.

Constructor detail
XMLObjectFactory()constructor
public function XMLObjectFactory(source:* = null)

Creates a new XmlObjectFactory

Parameters
source:* (default = null) — the path to the xml config file as a String or as an Array
Method detail
addConfig()method
public function addConfig(config:XML):void

Use this method to add xml versions of configurations

Parameters
config:XML — The xml configuration to add
addConfigLocation()method 
public function addConfigLocation(configLocation:String):void

Use this method to add aditional configuration locations.

Parameters
configLocation:String — The location to add. This is the path to the configuration xml file
addEmbeddedConfig()method 
public function addEmbeddedConfig(config:Class):void

Adds an embedded config.

Parameters
config:Class
addImportLocationsIfAny()method 
protected function addImportLocationsIfAny(xml:XML):void

Checks if the given xml data contains any tags. If any are found, their corresponding xml file is added to the load queue.

Parameters
xml:XML
afterParse()method 
protected function afterParse():void

Hook method, executed after the xml context is parsed.

beforeParse()method 
protected function beforeParse():void

Hook method, executed before the xml context is parsed.

cleanupLoader()method 
protected function cleanupLoader():void

If the _loader variable is not null the onLoaderComplete and onIOError event handlers are removed.

getBaseURL()method 
protected function getBaseURL(url:String):String

Returns the base url of the file this loading is loading.

Parameters
url:String

Returns
String
load()method 
public function load():void

This method will internally do the following:

Instructs the object factory to start loading the available configuration(s)

See also

loadConfigLocation()method 
protected function loadConfigLocation(configLocation:String):void

Will load a configLocation

Parameters
configLocation:String
XMLObjectFactoryInit()method 
protected function XMLObjectFactoryInit(source:*):void

Initializes the XMLObjectFactoryInit instance

Parameters
source:*
Event detail
completeevent 
Event object type: flash.events.Event

Dispatched as a result of a call to the load method when all available configurations have been parsed.

See also

ioErrorevent  
Event object type: flash.events.IOErrorEvent

Dispatched when an input or output error occurs that causes a load operation to fail.

See also