new Container()
- Source:
Methods
_addDefinition(name, definition)
Register new service definition
Parameters:
Name | Type | Description |
---|---|---|
name |
String | |
definition |
Definition |
- Source:
_addService(name, service)
Add service to the contianer
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
service |
Object |
- Source:
_constructArgument(reference) → {any}
Build up the argument that has to be passed to the service constructor
Parameters:
Name | Type | Description |
---|---|---|
reference |
string |
- Source:
Returns:
- Type
- any
_constructArguments(args) → {Array.<any>}
Parameters:
Name | Type | Description |
---|---|---|
args |
Array.<string> |
- Source:
Returns:
- Type
- Array.<any>
_createService(name) → {Object}
Instanciate a service if required
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
- Source:
Returns:
- Type
- Object
_fillParameter(parameter) → {string}
Check if parameter consists of multiple references like `%app.name%/%env.dir%/%path.to.whatever%`
Parameters:
Name | Type | Description |
---|---|---|
parameter |
string |
- Source:
Returns:
- Type
- string
_getDefinitionByName(name) → {Definition}
Get definition by name
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
- Source:
Returns:
- Type
- Definition
_getRecursiveParameterByName(name) → {Boolean|Number|String|Object}
Access parameter by given path like `app.namespace.app.config`
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
- Source:
Returns:
- Type
- Boolean | Number | String | Object
_getServiceByName(name) → {Object|null}
Get service by a name
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
- Source:
Returns:
- Type
- Object | null
_load()
Load the data into the container
- Source:
_loadDefaultParameters()
Set default parameters
- Source:
_loadModuleClassDefinition(def) → {Object}
Load the source for the module
Parameters:
Name | Type | Description |
---|---|---|
def |
Definition |
- Source:
Returns:
- Type
- Object
addParameters(parametersopt)
Add parameters to the container
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
parameters |
Object |
<optional> |
{} |
- Source:
get(name) → {Object}
get a service
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
- Source:
Returns:
- Type
- Object
getParameter(name) → {Boolean|Number|String|Object}
Get parameter
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
- Source:
Returns:
- Type
- Boolean | Number | String | Object
getServicesByTag(tag) → {Array.<Object>}
Get services by tag
Parameters:
Name | Type | Description |
---|---|---|
tag |
string |
- Source:
Returns:
- Type
- Array.<Object>