- Timestamp:
- 03/14/10 00:42:28 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/ICompositeSerializer.cs
r2993 r3016 5 5 namespace HeuristicLab.Persistence.Interfaces { 6 6 7 /// <summary> 8 /// A composite serializer does not directly transform an object into its 9 /// serialized form. It merely decomposes into other objects, that can 10 /// later be used to recompose the same object. 11 /// </summary> 7 12 public interface ICompositeSerializer { 8 13 9 14 /// <summary> 10 15 /// Defines the Priorty of this composite serializer. Higher number means 11 /// higher prioriy. Negative numbers are fallback serializers. 16 /// higher prioriy. Negative numbers are fallback serializers that are 17 /// disabled by default. 18 /// 12 19 /// All default generic composite serializers have priority 100. Specializations 13 20 /// have priority 200 so they will be tried first. Priorities are … … 18 25 /// <summary> 19 26 /// Determines for every type whether the composite serializer is applicable. 20 /// </summary> 27 /// </summary> 28 /// <param name="type">The type.</param> 29 /// <returns> 30 /// <c>true</c> if this instance can serialize the specified type; otherwise, <c>false</c>. 31 /// </returns> 21 32 bool CanSerialize(Type type); 22 33 … … 25 36 /// ICompositeSerializer. 26 37 /// </summary> 38 /// <param name="type">The type.</param> 39 /// <returns>A string justifying why type cannot be serialized.</returns> 27 40 string JustifyRejection(Type type); 28 41 29 42 /// <summary> 30 /// Generate MetaInfo necessary for instance creation. (i.e. 31 /// array dimensions). 32 /// </summary> 43 /// Generate MetaInfo necessary for instance creation. (e.g. dimensions 44 /// necessary for array creation (see <see cref="ArraySerializer"/>). 45 /// </summary> 46 /// <param name="obj">An object.</param> 47 /// <returns>An enumerable of <see cref="Tag"/>s.</returns> 33 48 IEnumerable<Tag> CreateMetaInfo(object obj); 34 49 35 50 /// <summary> 36 /// Decompose an object into KeyValuePairs, the Keycan be null,51 /// Decompose an object into <see cref="Tag"/>s, the tag name can be null, 37 52 /// the order in which elements are generated is guaranteed to be 38 53 /// the same as they will be supplied to the Populate method. 39 /// </summary> 54 /// </summary> 55 /// <param name="obj">An object.</param> 56 /// <returns>An enumerable of <see cref="Tag"/>s.</returns> 40 57 IEnumerable<Tag> Decompose(object obj); 41 58 … … 43 60 /// Create an instance of the object using the provided meta information. 44 61 /// </summary> 45 /// <param name="type"></param> 46 /// <returns></returns> 62 /// <param name="type">A type.</param> 63 /// <param name="metaInfo">The meta information.</param> 64 /// <returns>A fresh instance of the provided type.</returns> 47 65 object CreateInstance(Type type, IEnumerable<Tag> metaInfo); 48 66 49 67 /// <summary> 50 /// Compose an object from the KeyValuePairs previously generated 51 /// in DeCompose. The order in which the values are supplied is 52 /// the same as they where generated. Keys might be null. 53 /// </summary> 68 /// Fills an object with values from the previously generated <see cref="Tag"/>s 69 /// in Decompose. The order in which the values are supplied is 70 /// the same as they where generated. <see cref="Tag"/> names might be null. 71 /// </summary> 72 /// <param name="instance">An empty object instance.</param> 73 /// <param name="tags">The tags.</param> 74 /// <param name="type">The type.</param> 54 75 void Populate(object instance, IEnumerable<Tag> tags, Type type); 55 76 }
Note: See TracChangeset
for help on using the changeset viewer.