Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Persistence/Interfaces/IDecomposer.cs @ 1526

Last change on this file since 1526 was 1454, checked in by epitzer, 16 years ago

merge persistence exploration branch into trunk as HL plugin. (#506)

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using HeuristicLab.Persistence.Core;
4
5namespace HeuristicLab.Persistence.Interfaces {
6
7  public interface IDecomposer {
8
9    /// <summary>
10    /// Determines for every type whether the decomposer is applicable.
11    /// </summary>   
12    bool CanDecompose(Type type);
13
14    /// <summary>
15    /// Decompose an object into KeyValuePairs, the Key can be null,
16    /// the order in which elements are generated is guaranteed to be
17    /// the same as they are supplied in the Compose method.
18    /// </summary>   
19    IEnumerable<Tag> DeCompose(object obj);
20
21    /// <summary>
22    /// Create an instance of the object if possible. May return null
23    /// in which case the Populate method must create the instance.
24    /// </summary>
25    /// <param name="type"></param>
26    /// <returns></returns>
27    object CreateInstance(Type type);
28
29    /// <summary>
30    /// Compose an object from the KeyValuePairs previously generated
31    /// in DeCompose. The order in which the values are supplied is
32    /// the same as they where generated. Keys might be null.
33    /// </summary>   
34    object Populate(object instance, IEnumerable<Tag> tags, Type type);
35  } 
36
37}
Note: See TracBrowser for help on using the repository browser.