| Package | org.springextensions.actionscript.context.metadata |
| SVN browsing | ObjectDefinitionScanner.as |
| Fisheye | ObjectDefinitionScanner.as |
| Class | public class ObjectDefinitionScanner |
| Implements | IApplicationDomainAware |
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"]);
| Property | Defined by | ||
|---|---|---|---|
| applicationDomain : ApplicationDomain [write-only]
| ObjectDefinitionScanner | ||
| Method | Defined 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 | ||
| Constant | Defined 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 | ||
| applicationDomain | property |
applicationDomain:ApplicationDomain [write-only]Implementation
public function set applicationDomain(value:ApplicationDomain):void
| ObjectDefinitionScanner | () | constructor |
public function ObjectDefinitionScanner()
Creates a new ObjectDefinitionScanner instance.
| scan | () | method |
public function scan(basePackages:Array = null):ObjectScans 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.
ParametersbasePackages:Array (default = null) — an array with the packages that will be scanned
|
Object — a map <String, IObjectDefinition> with object definitions
|
| AUTOWIRE_ATTR | constant |
public static const AUTOWIRE_ATTR:String = "autowire"The "autowire" attribute.
| COMPONENT_METADATA | constant |
public static const COMPONENT_METADATA:String = "Component"The Component metadata.
| FACTORY_METHOD_ATTR | constant |
public static const FACTORY_METHOD_ATTR:String = "factoryMethod"The "factoryMethod" attribute.
| LAZY_INIT_ATTR | constant |
public static const LAZY_INIT_ATTR:String = "lazyInit"The "lazyInit" attribute.
| SCANNED_COMPONENT_NAME_PREFIX | constant |
public static const SCANNED_COMPONENT_NAME_PREFIX:String = "scannedComponent"The prefix used when generating object definition names.
| SCOPE_ATTR | constant |
public static const SCOPE_ATTR:String = "scope"The "scope" attribute.