Constructor
new ObjectManager(options)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | The configuration options Properties
|
- Source:
Methods
addConfiguration(config, rootopt)
Adds a configuration to the Object Manager
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
object | The configuration object |
|
root |
String |
<optional> |
The configuration root, that can be used to inject settings. |
- Source:
addDependencyTree(root)
Adds a new dependency tree to the stack
Parameters:
Name | Type | Description |
---|---|---|
root |
string | The name of the tree |
- Source:
connectObjectManager(objectManager)
Connect another object manager to this instance. Local resolvable modules will have precedence before modules of additional object managers.
Parameters:
Name | Type | Description |
---|---|---|
objectManager |
ObjectManager | The object manager to connect |
- Source:
getConfigInjector(configurationIdentifier) → {Object}
Generates an injector definition for a configuration setting.
Parameters:
Name | Type | Description |
---|---|---|
configurationIdentifier |
string | The configuration identifier of the module |
- Source:
Returns:
- Type
- Object
getContainingObjectManager(moduleName) → {ObjectManager}
Get the object manager which can create an instance of the module. If no available object manager including this instance can resolve the module, nothing is returned.
Parameters:
Name | Type | Description |
---|---|---|
moduleName |
string |
- Source:
Returns:
- Type
- ObjectManager
getInjectionConfiguration(moduleName) → {InjectionConfiguration}
Returns the injection configuration of a module
Parameters:
Name | Type | Description |
---|---|---|
moduleName |
String | The name of the module |
- Source:
Returns:
getInstance(moduleName, treeopt) → {*}
Returns an instance of a module by name. All dependencies will be injected.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
moduleName |
string | The name of the module. Must match the Module name or one of its alias |
|
tree |
string |
<optional> |
The tree to use. Defaults to "root" |
- Source:
Returns:
The instance of the module
- Type
- *
getInstantiator(name) → {AbstractInstantiator}
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The Name of the instantiator |
- Source:
Returns:
- Type
- AbstractInstantiator
getModuleInjector(moduleIdentifier) → {Object}
Generates an injector definition for the injection of a module
Parameters:
Name | Type | Description |
---|---|---|
moduleIdentifier |
string | The module identifier |
- Source:
Returns:
- Type
- Object
getModuleParams(injectors, root, requestId) → {*|Object|Uint8Array|Array.<any>|Int32Array|Uint16Array}
Will resolve all instances and configurations needed to instantiate a module.
Parameters:
Name | Type | Description |
---|---|---|
injectors |
Array | The injector definitions to resolve |
root |
string | The tree to request the injectable parameters from |
requestId |
string | The unique requestId to discover circular dependencies |
- Source:
Returns:
- Type
- * | Object | Uint8Array | Array.<any> | Int32Array | Uint16Array
registerInstantiator(name, instantiator)
Registers a new Instantiator
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The id which this instantiator is used with. |
instantiator |
AbstractInstantiator | An instance of the instantiator |
- Source:
requestInstanceOfModule(moduleName, treeIdentifieropt, _requestIdopt) → {*}
Requests an instance of a module. All dependencies will be injected also into submodules.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
moduleName |
string | The name of the module. Must match the Module name or one of its alias |
||
treeIdentifier |
string |
<optional> |
root | The tree to use. Default is "root" |
_requestId |
int |
<optional> |
Internal parameter to detect circular dependencies |
- Source:
Returns:
- Type
- *