DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Properties | List of all members
Deveel.Data.Configuration.IConfiguration Interface Reference

Defines the contract for the configuration node of a component within the system or of the system itself. More...

Inheritance diagram for Deveel.Data.Configuration.IConfiguration:
Deveel.Data.Configuration.Configuration

Public Member Functions

IEnumerable< string > GetKeys (ConfigurationLevel level)
 Enumerates the keys that can be obtained by the object, at the given ConfigurationLevel. More...
 
void SetValue (string key, object value)
 Sets a given value for a key defined by this object. More...
 
object GetValue (string key)
 Gets a configuration setting for the given key. More...
 

Properties

IConfigSource Source [get, set]
 Gets or sets an optional source of the configuration object More...
 
IConfiguration Parent [get, set]
 Gets or sets an optional parent object of this configuration. More...
 

Detailed Description

Defines the contract for the configuration node of a component within the system or of the system itself.

Since the configurations can be structured in nodes of a tree, it is possible to define a Parent, that will be used to resolve a key and value of a setting, if the current node does not define it by itself.

Definition at line 33 of file IConfiguration.cs.

Member Function Documentation

IEnumerable<string> Deveel.Data.Configuration.IConfiguration.GetKeys ( ConfigurationLevel  level)

Enumerates the keys that can be obtained by the object, at the given ConfigurationLevel.

Parameters
levelThe level of definition of the keys to get.
Returns
Returns an enumeration of string representing the keys that are accessible from this object, depending on the level of nesting given.
See also
ConfigurationLevel

Implemented in Deveel.Data.Configuration.Configuration.

object Deveel.Data.Configuration.IConfiguration.GetValue ( string  key)

Gets a configuration setting for the given key.

Parameters
keyThe key that identifies the setting to retrieve.
Returns
Returns a configuration value if defined by the provided key, or null if the key was not found in this or in the parent context.

Implemented in Deveel.Data.Configuration.Configuration.

void Deveel.Data.Configuration.IConfiguration.SetValue ( string  key,
object  value 
)

Sets a given value for a key defined by this object.

Parameters
keyThe key to set the value for, that was defined before.
valueThe value to set.

If the given key was not previously defined, this method will add the key at this level of configuration

Setting a value for a given key that was already defined by a parent object will override that value: a subsequent call to GetValue will return the current value of the setting, without removing the parent value setting.

Exceptions
ArgumentNullExceptionIf the given key is null.

Implemented in Deveel.Data.Configuration.Configuration.

Property Documentation

IConfiguration Deveel.Data.Configuration.IConfiguration.Parent
getset

Gets or sets an optional parent object of this configuration.

The tree structure of a configuration object makes the request for a given setting to fallback to parents if the object does not define the key itself.

A typical example of a parent/child structure is the configuration of a database system and the configuration of a single database: the system defines default values for all the databases, while a single database can override a setting or define new settings.

Definition at line 61 of file IConfiguration.cs.

IConfigSource Deveel.Data.Configuration.IConfiguration.Source
getset

Gets or sets an optional source of the configuration object

This property is optional and it is convenient when it is required to save or reload the values to/from the source, retaining a reference to the origin.

See also
IConfigSource

Definition at line 43 of file IConfiguration.cs.


The documentation for this interface was generated from the following file: