IOptionManager
Extends IChild, IEventEmitter, IFreezable.
Interface for the options manager. The options manager lets you set option values, build an options inheritance hierarchy, and resolve option values in the context of the existing inheritance hierarchy.
Constructor | Fields | Events | Methods
Constructor
IOptionManager()
Fields
Name |
Type |
Description |
Event manager for the object. Inherited from IFreezable. |
Events
Name |
Description |
Changes to the option. |
|
The parent object reference changed. Data fields:
Inherited from IChild. |
Methods
Name |
Returns |
Description |
freeze() |
Switches the object to "frozen" mode. Inherited from IFreezable. |
|
get(key[, defaultValue]) |
Returns the value of the specified option in the context of the existing options inheritance hierarchy. When this method is called, first values are searched for in the current options manager, then, if the value is not defined, the search continues in the hierarchy of parent managers. |
|
getAll() |
Object |
Returns a reference to the internal hash that stores option values. |
getName() |
String |
Returns name of the options manager. |
Object |
Returns the value of the specified option that is defined for the given level of the options hierarchy, i.e. in this manager. |
|
IOptionManager|null |
Returns parent options manager. |
|
isFrozen() |
Boolean |
Returns true if the object is in "frozen" mode, otherwise false. Inherited from IFreezable. |
Object |
Method intended to be called by child options managers. |
|
Sets the name of the options manager. |
||
Sets the parent options manager. |
||
unfreeze() |
Switches the object to active mode. Inherited from IFreezable. |
Events details
change
Changes to the option.
Methods details
get
{} get(key[, defaultValue])
Returns the value of the specified option in the context of the existing options inheritance hierarchy. When this method is called, first values are searched for in the current options manager, then, if the value is not defined, the search continues in the hierarchy of parent managers.
Parameters:
Parameter |
Default value |
Description |
|
— |
Type: String Name of the option. |
— |
Type: Object Default value. |
* Mandatory parameter/option.
getAll
{Object} getAll()
Returns a reference to the internal hash that stores option values.
getName
{String} getName()
Returns name of the options manager.
getNative
{Object} getNative(key)
Returns the value of the specified option that is defined for the given level of the options hierarchy, i.e. in this manager.
Parameters:
Parameter |
Default value |
Description |
|
— |
Type: String Name of the option. |
* Mandatory parameter/option.
getParent
{IOptionManager|null} getParent()
Returns parent options manager.
resolve
{Object} resolve(key[, name])
Method intended to be called by child options managers.
Returns the option's value in the parent context.
Parameters:
Parameter |
Default value |
Description |
|
— |
Type: String Name of the option. |
— |
Type: String Name of the child options manager. |
* Mandatory parameter/option.
setName
{} setName(name)
Sets the name of the options manager.
Parameters:
Parameter |
Default value |
Description |
|
— |
Type: String Name of the options manager. |
* Mandatory parameter/option.
setParent
{IChild} setParent(parent)
Sets the parent options manager.
Returns self-reference.
Parameters:
Parameter |
Default value |
Description |
— |
Type: IOptionManager|null Parent options manager. |
* Mandatory parameter/option.
Mandatory parameter/option.