Class
caplin.menu.model

MenuFactory

This class allows the user to create a model from a configuration map. Example: { alias:'caplin.anAlias', options: { label: 'a Label', otherOption: 'something' }, items: [ { alias:'caplinx.myAlias', }, { options: { label: 'another label' } } ] }

The table below explains each possible option to represent a caplin.menu.Model.

namedefaulttypedescription
aliasString The alias for the model to create. This parameter is optional, either a caplin.menu.model.Item or a caplin.menu.model.Menu will be created in case an alias is not provided.
optionsMap The options which will be passed to the model that is created. This parameter is optional.
itemsarray An array of caplin.menu.Model configuration map representations. This parameter is optional.

Constructor Summary

Attributes Name and Description
caplin.menu.model.MenuFactory()

Method Summary

Attributes Name and Description
<static> caplin.menu.Model create(Map config)

Returns an instance of a caplin.menu.Model represented configuration map passed as a parameter.

Constructor Detail

caplin.menu.model.MenuFactory()

Method Detail

<static> caplin.menu.Model create(Map config)

Returns an instance of a caplin.menu.Model represented configuration map passed as a parameter.

Parameters
Map config Map to recreate the model from.
Throws
caplin.core.Error
If config is not a valid object.
caplin.core.Error
If an instance of caplin.menu.model.Menu gets generated but no items get provided or the 'items' section is not an array.
Returns
{caplin.menu.Model}