object Deveel.Data.Configuration.PropertiesConfigFormatter.ConvertValueTo |
( |
string |
value, |
|
|
Type |
valueType |
|
) |
| |
|
inlineprivate |
void Deveel.Data.Configuration.PropertiesConfigFormatter.LoadInto |
( |
IConfiguration |
config, |
|
|
Stream |
inputStream |
|
) |
| |
|
inline |
Loads a stored configuration from the given stream into the configuration argument.
- Parameters
-
config | The configuration object inside of which to load the configurations from the the given stream. |
inputStream | The stream from where to read the configurations formatted into the object provided as argument. |
- Exceptions
-
ArgumentException | If the provided inputStream cannot be read. |
ArgumentNullException | If either config or inputStream are null . |
Implements Deveel.Data.Configuration.IConfigFormatter.
Definition at line 35 of file PropertiesConfigFormatter.cs.
36 if (inputStream == null)
37 throw new ArgumentNullException(
"inputStream");
41 properties.Load(inputStream);
43 foreach (var entry
in properties) {
44 var propKey = (string) entry.Key;
45 SetValue(config, propKey, (
string) entry.Value);
47 }
catch (DatabaseConfigurationException) {
49 }
catch (Exception ex) {
50 throw new DatabaseConfigurationException(
"Could not load properties from the given stream.", ex);
Stores the given level of configurations into the output stream provided, in the format handled by this interface.
- Parameters
-
config | The source of the configurations to store. |
level | The level of the configurations to load from the source and store. |
outputStream | The destination stream where the formatter saves the configurations retrieved from the source. |
- See also
- ConfigurationLevel
- Exceptions
-
ArgumentException | If the provided outputStream cannot be written. |
ArgumentNullException | If either config or outputStream are null . |
Implements Deveel.Data.Configuration.IConfigFormatter.
Definition at line 54 of file PropertiesConfigFormatter.cs.
56 var keys = config.GetKeys(level);
59 foreach (var configKey
in keys) {
60 var configValue = config.GetValue(configKey);
61 if (configValue != null) {
62 var stringValue = Convert.ToString(configValue, CultureInfo.InvariantCulture);
63 properties.SetProperty(configKey, stringValue);
67 properties.Store(outputStream,
String.Empty);
68 }
catch (DatabaseConfigurationException) {
70 }
catch (Exception ex) {
71 throw new DatabaseConfigurationException(
"Could not save the configurations to the given stream.", ex);
A long string in the system.
void Deveel.Data.Configuration.PropertiesConfigFormatter.SetValue |
( |
IConfiguration |
config, |
|
|
string |
propKey, |
|
|
string |
value |
|
) |
| |
|
inlineprivate |
The documentation for this class was generated from the following file: