Configuration Adapter Module for Base Library
This is a generic data storage for configuration properties. Options are stored as properties of a private config object. They can be accessed using setOptions() to set one or several options, and getOption() to retrieve a single value.
Eric Bréchemier © 2011-2013, Some Rights Reserved Legal-Box SAS © 2010-2011, All Rights Reserved
BSD License http://creativecommons.org/licenses/BSD/
2013-09-10
lb. | Configuration Adapter Module for Base Library |
Functions | |
reset() | Remove all options from configuration. |
setOptions(options) | Set one or several configuration options. |
getOption(name, defaultValue) |
Set one or several configuration options.
Each new option is added to the configuration, replacing any existing value of the same name. Options previously set are otherwise preserved.
In order to avoid clashes in the names of configuration properties, each property should use a prefix corresponding to the implementor of the module which makes use of it. All configuration properties used in modules implemented by Legal-Box will use the prefix ‘lb’, e.g. ‘lbFactory’ for the DOM Element Factory.
options | object, a set of configuration properties |
name | string, name of the configuration property to retrieve |
defaultValue | any, optional default value to return in case the configuration value is undefined or null. The default value itself defaults to null. |