Last change
on this file since 2591 was
1823,
checked in by epitzer, 16 years ago
|
Namespace refactoring: rename formatters & decomposers -> primitive and composite serializers. (#603)
|
File size:
1.8 KB
|
Rev | Line | |
---|
[1454] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using HeuristicLab.Persistence.Core;
|
---|
| 4 |
|
---|
| 5 | namespace HeuristicLab.Persistence.Interfaces {
|
---|
| 6 |
|
---|
[1823] | 7 | public interface ICompositeSerializer {
|
---|
[1454] | 8 |
|
---|
| 9 | /// <summary>
|
---|
[1823] | 10 | /// Defines the Priorty of this composite serializer. Higher number means
|
---|
| 11 | /// higher prioriy. Negative numbers are fallback serializers.
|
---|
| 12 | /// All default generic composite serializers have priority 100. Specializations
|
---|
[1539] | 13 | /// have priority 200 so they will be tried first. Priorities are
|
---|
| 14 | /// only considered for default configurations.
|
---|
| 15 | /// </summary>
|
---|
| 16 | int Priority { get; }
|
---|
| 17 |
|
---|
| 18 | /// <summary>
|
---|
[1823] | 19 | /// Determines for every type whether the composite serializer is applicable.
|
---|
[1454] | 20 | /// </summary>
|
---|
[1823] | 21 | bool CanSerialize(Type type);
|
---|
[1454] | 22 |
|
---|
| 23 | /// <summary>
|
---|
[1553] | 24 | /// Generate MetaInfo necessary for instance creation. (i.e.
|
---|
| 25 | /// array dimensions).
|
---|
| 26 | /// </summary>
|
---|
| 27 | IEnumerable<Tag> CreateMetaInfo(object obj);
|
---|
| 28 |
|
---|
| 29 | /// <summary>
|
---|
[1454] | 30 | /// Decompose an object into KeyValuePairs, the Key can be null,
|
---|
| 31 | /// the order in which elements are generated is guaranteed to be
|
---|
[1553] | 32 | /// the same as they will be supplied to the Populate method.
|
---|
[1454] | 33 | /// </summary>
|
---|
[1542] | 34 | IEnumerable<Tag> Decompose(object obj);
|
---|
[1454] | 35 |
|
---|
| 36 | /// <summary>
|
---|
[1553] | 37 | /// Create an instance of the object using the provided meta information.
|
---|
[1454] | 38 | /// </summary>
|
---|
| 39 | /// <param name="type"></param>
|
---|
| 40 | /// <returns></returns>
|
---|
[1553] | 41 | object CreateInstance(Type type, IEnumerable<Tag> metaInfo);
|
---|
[1454] | 42 |
|
---|
| 43 | /// <summary>
|
---|
| 44 | /// Compose an object from the KeyValuePairs previously generated
|
---|
| 45 | /// in DeCompose. The order in which the values are supplied is
|
---|
| 46 | /// the same as they where generated. Keys might be null.
|
---|
| 47 | /// </summary>
|
---|
[1553] | 48 | void Populate(object instance, IEnumerable<Tag> tags, Type type);
|
---|
[1566] | 49 | }
|
---|
[1454] | 50 |
|
---|
| 51 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.