Packageorg.springextensions.actionscript.ioc.factory.config
SVN browsingRequiredMetadataObjectPostProcessor.as
FisheyeRequiredMetadataObjectPostProcessor.as
Classpublic class RequiredMetadataObjectPostProcessor
InheritanceRequiredMetadataObjectPostProcessor Inheritance AbstractMetadataProcessor
ImplementsIObjectFactoryAware

IMetadataProcessor implementation that enforces required properties to have been configured. A property is marked as required by adding [Required] metadata to the property definition:
  [Required]
  public var myProperty:Type;
  

In order to add this post processor to you configuration add the following line to the xml:

<object class="org.springextensions.actionscript.ioc.factory.config.RequiredMetadataObjectPostProcessor" />

Author: Christophe Herreman
Version: $Revision: 21 $, $Date: 2008-11-01 22:58:42 +0100 (za, 01 nov 2008) $, $Author: dmurat $
Since: 0.1



Documentation reference: enforcing required property injections


Public Properties
 PropertyDefined by
 InheritedmetadataNames : Array
The names of the metadata annotations that the current IMetadataProcessor processes.
AbstractMetadataProcessor
  objectFactory : IObjectFactory
[write-only]
RequiredMetadataObjectPostProcessor
 InheritedprocessBeforeInitialization : Boolean
If true the IMetadataProcessor instance will be able to process the annotated instance before it has been initialized by the container.
AbstractMetadataProcessor
Public Methods
 MethodDefined by
  
Constructs RequiredMetadataObjectPostProcessor
RequiredMetadataObjectPostProcessor
  
postProcessAfterInitialization(object:*, objectName:String):*
This method has not been implemented
RequiredMetadataObjectPostProcessor
  
process(instance:Object, container:IMetaDataContainer, name:String, objectName:String):void
Will check the metadata of the given object to see if any property contains [Required] metadata.
RequiredMetadataObjectPostProcessor
Protected Methods
 MethodDefined by
 Inherited
init(processBefore:Boolean, metadataNames:Array):void
Initializes the current AbstractMetadataProcessor.
AbstractMetadataProcessor
Property detail
objectFactoryproperty
objectFactory:IObjectFactory  [write-only]

Implementation
    public function set objectFactory(value:IObjectFactory):void
Constructor detail
RequiredMetadataObjectPostProcessor()constructor
public function RequiredMetadataObjectPostProcessor()

Constructs RequiredMetadataObjectPostProcessor

Method detail
postProcessAfterInitialization()method
public function postProcessAfterInitialization(object:*, objectName:String):*

This method has not been implemented

Parameters
object:*
 
objectName:String

Returns
*
process()method 
public override function process(instance:Object, container:IMetaDataContainer, name:String, objectName:String):void

Will check the metadata of the given object to see if any property contains [Required] metadata. If it has this type of metadata and is not available in the object definition an error will be thrown. Throws an error when invoked directly, needs to be overriden by a subclass.

Parameters
instance:Object — The object that has been instantiated
 
container:IMetaDataContainer — The name of the object
 
name:String
 
objectName:String

Throws
— If the property was required but not defined.