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

events

IEventManager

Event manager for the object.

Inherited from IFreezable.

Events

Name

Description

change

Changes to the option.

parentchange

The parent object reference changed.

Data fields:

  • oldParent - Old parent.
  • newParent - New parent.

Inherited from IChild.

Methods

Name

Returns

Description

freeze()

IFreezable

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.

getNative(key)

Object

Returns the value of the specified option that is defined for the given level of the options hierarchy, i.e. in this manager.

getParent()

IOptionManager|null

Returns parent options manager.

isFrozen()

Boolean

Returns true if the object is in "frozen" mode, otherwise false.

Inherited from IFreezable.

resolve(key[, name])

Object

Method intended to be called by child options managers.

setName(name)

Sets the name of the options manager.

setParent(parent)

IChild

Sets the parent options manager.

unfreeze()

IFreezable

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

key*

—

Type: String

Name of the option.

defaultValue

—

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

key*

—

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

key*

—

Type: String

Name of the option.

name

—

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

name*

—

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

parent*

—

Type: IOptionManager|null

Parent options manager.

* Mandatory parameter/option.