Packageorg.springextensions.actionscript.context.metadata
SVN browsingObjectDefinitionScanner.as
FisheyeObjectDefinitionScanner.as
Classpublic class ObjectDefinitionScanner
ImplementsIApplicationDomainAware

The ObjectDefinitionScanner scans all classes in the application and builds object definitions from the classes that contain [Component] metadata. This eliminates the need to configure the object definition in XML or MXML.

To configure a class, eligible for component scanning, annotate it with [Component] metadata. Optionally you can assign it an id ([Component(id="myComponent")]) or use other attributes such as "scope", "lazyInit", "factoryMethod", "autowire".

To execute a scan, call the scan() method and pass in the packages that you want to scan.

e.g. scanner.scan(["com.company.services", "com.company.view"]);



Public Properties
 PropertyDefined by
  applicationDomain : ApplicationDomain
[write-only]
ObjectDefinitionScanner
Public Methods
 MethodDefined by
  
Creates a new ObjectDefinitionScanner instance.
ObjectDefinitionScanner
  
scan(basePackages:Array = null):Object
Scans the classes of the given packages for [Component] metadata on the class level and returns all matching classes as object definitions, ready to be added to the container.
ObjectDefinitionScanner
Public Constants
 ConstantDefined by
  AUTOWIRE_ATTR : String = "autowire"
[static] The "autowire" attribute.
ObjectDefinitionScanner
  COMPONENT_METADATA : String = "Component"
[static] The Component metadata.
ObjectDefinitionScanner
  FACTORY_METHOD_ATTR : String = "factoryMethod"
[static] The "factoryMethod" attribute.
ObjectDefinitionScanner
  LAZY_INIT_ATTR : String = "lazyInit"
[static] The "lazyInit" attribute.
ObjectDefinitionScanner
  SCANNED_COMPONENT_NAME_PREFIX : String = "scannedComponent"
[static] The prefix used when generating object definition names.
ObjectDefinitionScanner
  SCOPE_ATTR : String = "scope"
[static] The "scope" attribute.
ObjectDefinitionScanner
Property detail
applicationDomainproperty
applicationDomain:ApplicationDomain  [write-only]

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

Creates a new ObjectDefinitionScanner instance.

Method detail
scan()method
public function scan(basePackages:Array = null):Object

Scans the classes of the given packages for [Component] metadata on the class level and returns all matching classes as object definitions, ready to be added to the container.

Parameters
basePackages:Array (default = null) — an array with the packages that will be scanned

Returns
Object — a map <String, IObjectDefinition> with object definitions
Constant detail
AUTOWIRE_ATTRconstant
public static const AUTOWIRE_ATTR:String = "autowire"

The "autowire" attribute.

COMPONENT_METADATAconstant 
public static const COMPONENT_METADATA:String = "Component"

The Component metadata.

FACTORY_METHOD_ATTRconstant 
public static const FACTORY_METHOD_ATTR:String = "factoryMethod"

The "factoryMethod" attribute.

LAZY_INIT_ATTRconstant 
public static const LAZY_INIT_ATTR:String = "lazyInit"

The "lazyInit" attribute.

SCANNED_COMPONENT_NAME_PREFIXconstant 
public static const SCANNED_COMPONENT_NAME_PREFIX:String = "scannedComponent"

The prefix used when generating object definition names.

SCOPE_ATTRconstant 
public static const SCOPE_ATTR:String = "scope"

The "scope" attribute.