Packageorg.springextensions.actionscript.ioc.factory.xml.preprocessors
SVN browsingInterfacePreprocessor.as
FisheyeInterfacePreprocessor.as
Classpublic class InterfacePreprocessor
ImplementsIApplicationDomainAware, IXMLObjectDefinitionsPreprocessor

A IXMLObjectDefinitionsPreprocessor instance that retrieves all <interface/> elements, looks up the <object/> definitions that have classes that implement these interfaces and copies the configuration nodes from the interfaces to the appropriate <object/> elements.



Documentation reference: handling object inheritance using interfaces


Public Properties
 PropertyDefined by
  applicationDomain : ApplicationDomain
[write-only]
InterfacePreprocessor
Public Methods
 MethodDefined by
  
InterfacePreprocessor(applicationDomain:ApplicationDomain)
Creates a new InterfacePreprocessor instance.
InterfacePreprocessor
  
preprocess(xml:XML):XML
Retrieves all the <interface/> nodes, looks up the appropriate <object/> nodes and copies the interface configuration into them.
InterfacePreprocessor
Protected Methods
 MethodDefined by
  
hasChildElementWithName(node:XML, childElementName:String, namePropertyValue:String):Boolean
InterfacePreprocessor
  
lookupImplementingObjects(xml:XML, interfaceName:String):Array
Returns all the <object/> nodes that define a class that implements the specified interface.
InterfacePreprocessor
Public Constants
 ConstantDefined by
  CLASS_ATTR : String = "class"
[static]
InterfacePreprocessor
Property detail
applicationDomainproperty
applicationDomain:ApplicationDomain  [write-only]

Implementation
    public function set applicationDomain(value:ApplicationDomain):void
Constructor detail
InterfacePreprocessor()constructor
public function InterfacePreprocessor(applicationDomain:ApplicationDomain)

Creates a new InterfacePreprocessor instance.

Parameters
applicationDomain:ApplicationDomain
Method detail
hasChildElementWithName()method
protected function hasChildElementWithName(node:XML, childElementName:String, namePropertyValue:String):BooleanParameters
node:XML
 
childElementName:String
 
namePropertyValue:String

Returns
Boolean
lookupImplementingObjects()method 
protected function lookupImplementingObjects(xml:XML, interfaceName:String):Array

Returns all the <object/> nodes that define a class that implements the specified interface.

Parameters
xml:XML — The XML that contains the <object/> nodes
 
interfaceName:String — The name of the interface that objects need to implement

Returns
Array — A list of <object/> nodes with a class that implements the specified interface
preprocess()method 
public function preprocess(xml:XML):XML

Retrieves all the <interface/> nodes, looks up the appropriate <object/> nodes and copies the interface configuration into them.

Parameters
xml:XML — The specified XML that contains both the <interface/> and <object/> nodes

Returns
XML — The processed XML
Constant detail
CLASS_ATTRconstant
public static const CLASS_ATTR:String = "class"