Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/15/09 12:29:13 (15 years ago)
Author:
epitzer
Message:

Namespace refactoring: rename formatters & decomposers -> primitive and composite serializers. (#603)

Location:
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers
Files:
11 deleted
3 edited
11 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ArraySerializer.cs

    r1805 r1823  
    33using HeuristicLab.Persistence.Interfaces;
    44using System.Collections.Generic;
    5 using HeuristicLab.Persistence.Default.Decomposers.Storable;
     5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    66
    7 namespace HeuristicLab.Persistence.Default.Decomposers {
     7namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    88
    99  [EmptyStorableClass]
    10   public class ArrayDecomposer : IDecomposer {
     10  public class ArraySerializer : ICompositeSerializer {
    1111
    1212    public int Priority {
     
    1414    }
    1515
    16     public bool CanDecompose(Type type) {
     16    public bool CanSerialize(Type type) {
    1717      return type.IsArray || type == typeof(Array);
    1818    }
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs

    r1805 r1823  
    66using System.Globalization;
    77using System.Text;
    8 using HeuristicLab.Persistence.Default.Decomposers.Storable;
     8using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    99
    10 namespace HeuristicLab.Persistence.Default.Decomposers {
     10namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    1111
    1212  [EmptyStorableClass]
    13   public class CompactNumberArray2StringDecomposer : IDecomposer {
     13  public class CompactNumberArray2StringSerializer : ICompositeSerializer {
    1414
    1515    public int Priority {
     
    1717    }
    1818
    19     private static readonly Number2StringDecomposer numberConverter =
    20       new Number2StringDecomposer();
     19    private static readonly Number2StringSerializer numberConverter =
     20      new Number2StringSerializer();
    2121
    22     public bool CanDecompose(Type type) {
     22    public bool CanSerialize(Type type) {
    2323      return
    2424        (type.IsArray || type == typeof(Array)) &&
    25         numberConverter.CanDecompose(type.GetElementType());
     25        numberConverter.CanSerialize(type.GetElementType());
    2626    }
    2727
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs

    r1805 r1823  
    44using HeuristicLab.Persistence.Interfaces;
    55using System.Collections.Generic;
    6 using HeuristicLab.Persistence.Default.Decomposers.Storable;
     6using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    77using HeuristicLab.Persistence.Auxiliary;
    88
    9 namespace HeuristicLab.Persistence.Default.Decomposers {
     9namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    1010
    1111  [EmptyStorableClass]
    12   public class DictionaryDecomposer : IDecomposer {
     12  public class DictionarySerializer : ICompositeSerializer {
    1313
    1414    public int Priority {
     
    1717
    1818
    19     public bool CanDecompose(Type type) {
     19    public bool CanSerialize(Type type) {
    2020      return ReflectionTools.HasDefaultConstructor(type) &&
    2121        type.GetInterface(typeof(IDictionary).FullName) != null;
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs

    r1805 r1823  
    33using HeuristicLab.Persistence.Interfaces;
    44using System.Collections.Generic;
    5 using HeuristicLab.Persistence.Default.Decomposers.Storable;
     5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    66
    7 namespace HeuristicLab.Persistence.Default.Decomposers {
     7namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    88
    99  [EmptyStorableClass]
    10   public class EnumDecomposer : IDecomposer {
     10  public class EnumSerializer : ICompositeSerializer {
    1111
    1212    public int Priority {
     
    1414    }
    1515
    16     public bool CanDecompose(Type type) {
     16    public bool CanSerialize(Type type) {
    1717      return type.IsEnum || type == typeof(Enum);
    1818    }
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs

    r1805 r1823  
    55using HeuristicLab.Persistence.Interfaces;
    66using System.Collections.Generic;
    7 using HeuristicLab.Persistence.Default.Decomposers.Storable;
     7using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    88using HeuristicLab.Persistence.Auxiliary;
    99
    10 namespace HeuristicLab.Persistence.Default.Decomposers {
     10namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    1111
    1212  [EmptyStorableClass]
    13   public class EnumerableDecomposer : IDecomposer {
     13  public class EnumerableSerializer : ICompositeSerializer {
    1414
    1515    public int Priority {
     
    1818
    1919
    20     public bool CanDecompose(Type type) {
     20    public bool CanSerialize(Type type) {
    2121      return
    2222        ReflectionTools.HasDefaultConstructor(type) &&
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs

    r1805 r1823  
    55using HeuristicLab.Persistence.Interfaces;
    66using System.Reflection;
    7 using HeuristicLab.Persistence.Default.Decomposers.Storable;
     7using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    88
    9 namespace HeuristicLab.Persistence.Default.Decomposers {
     9namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    1010
    1111  [EmptyStorableClass]
    12   public class KeyValuePairDecomposer : IDecomposer {
     12  public class KeyValuePairSerializer : ICompositeSerializer {
    1313
    1414    public int Priority {
     
    1717
    1818
    19     public bool CanDecompose(Type type) {
     19    public bool CanSerialize(Type type) {
    2020      return type.IsGenericType &&
    2121             type.GetGenericTypeDefinition() ==
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs

    r1805 r1823  
    88using System.Text;
    99
    10 namespace HeuristicLab.Persistence.Default.Decomposers {
     10namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    1111
    12   public class Number2StringDecomposer : IDecomposer {
     12  public class Number2StringSerializer : ICompositeSerializer {
    1313
    1414    private static readonly List<Type> numberTypes =
     
    3030    private static readonly Dictionary<Type, MethodInfo> numberParsers;
    3131
    32     static Number2StringDecomposer() {
     32    static Number2StringSerializer() {
    3333      numberParsers = new Dictionary<Type, MethodInfo>();
    3434      foreach (var type in numberTypes) {
     
    3939    }
    4040
    41     public bool CanDecompose(Type type) {
     41    public bool CanSerialize(Type type) {
    4242      return numberParsers.ContainsKey(type);
    4343    }
     
    6666    }
    6767
    68 
    69     #region IDecomposer Members
    7068
    7169    public int Priority {
     
    9997      // numbers are composed just of meta info, no need to populate
    10098    }
    101 
    102     #endregion
    10399  }
    104 
    105100}
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs

    r1805 r1823  
    66using System.Globalization;
    77using System.Text;
    8 using HeuristicLab.Persistence.Default.Decomposers.Storable;
     8using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    99using HeuristicLab.Persistence.Auxiliary;
    1010
    11 namespace HeuristicLab.Persistence.Default.Decomposers {
     11namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    1212
    1313  [EmptyStorableClass]
    14   public class NumberEnumerable2StringDecomposer : IDecomposer {
     14  public class NumberEnumerable2StringSerializer : ICompositeSerializer {
    1515
    1616    public int Priority {
     
    1818    }
    1919
    20     private static readonly Number2StringDecomposer numberConverter =
    21       new Number2StringDecomposer();
     20    private static readonly Number2StringSerializer numberConverter =
     21      new Number2StringSerializer();
    2222
    2323    private static readonly Dictionary<Type, Type> interfaceCache = new Dictionary<Type, Type>();
     
    2929        if (iface.IsGenericType &&
    3030          iface.GetGenericTypeDefinition() == typeof(IEnumerable<>) &&
    31           numberConverter.CanDecompose(iface.GetGenericArguments()[0])) {
     31          numberConverter.CanSerialize(iface.GetGenericArguments()[0])) {
    3232          interfaceCache.Add(type, iface);
    3333          return iface;
     
    5353    }
    5454
    55     public bool CanDecompose(Type type) {
     55    public bool CanSerialize(Type type) {
    5656      return
    5757        ReflectionTools.HasDefaultConstructor(type) &&
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs

    r1805 r1823  
    55using HeuristicLab.Persistence.Interfaces;
    66using System.Collections.Generic;
    7 using HeuristicLab.Persistence.Default.Decomposers.Storable;
     7using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    88using System.IO;
    99
    10 namespace HeuristicLab.Persistence.Default.Decomposers {
     10namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    1111
    1212  [EmptyStorableClass]
    13   public class StackDecomposer : IDecomposer {
     13  public class StackSerializer : ICompositeSerializer {
    1414
    1515    public int Priority {
     
    1818
    1919
    20     public bool CanDecompose(Type type) {
     20    public bool CanSerialize(Type type) {
    2121      return type == typeof(Stack) ||
    2222        type.IsGenericType &&
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/DataMemberAccessor.cs

    r1625 r1823  
    33using HeuristicLab.Persistence.Core;
    44
    5 namespace HeuristicLab.Persistence.Default.Decomposers.Storable {
     5namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
    66
    77  public class DataMemberAccessor {
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/EmptyStorableClassAttribute.cs

    r1652 r1823  
    33using System.Reflection;
    44
    5 namespace HeuristicLab.Persistence.Default.Decomposers.Storable {
     5namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
    66
    77
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs

    r1623 r1823  
    33using System.Reflection;
    44
    5 namespace HeuristicLab.Persistence.Default.Decomposers.Storable {
     5namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
    66
    77  [AttributeUsage(
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs

    r1805 r1823  
    77using HeuristicLab.Persistence.Auxiliary;
    88
    9 namespace HeuristicLab.Persistence.Default.Decomposers.Storable {
     9namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
    1010
    1111  [EmptyStorableClass]
    12   public class StorableDecomposer : IDecomposer {
     12  public class StorableSerializer : ICompositeSerializer {
    1313
    1414    public int Priority {
     
    1616    }
    1717
    18     public bool CanDecompose(Type type) {
     18    public bool CanSerialize(Type type) {
    1919      return ReflectionTools.HasDefaultConstructor(type) &&
    2020        (StorableAttribute.GetStorableMembers(type, false).Count() > 0 ||
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs

    r1805 r1823  
    44using HeuristicLab.Persistence.Interfaces;
    55using System.Collections.Generic;
    6 using HeuristicLab.Persistence.Default.Decomposers.Storable;
     6using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    77
    8 namespace HeuristicLab.Persistence.Default.Decomposers {
     8namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    99
    1010  [EmptyStorableClass]
    11   public class TypeDecomposer : IDecomposer {
     11  public class TypeSerializer : ICompositeSerializer {
    1212
    1313    public int Priority {
     
    1515    }
    1616
    17     public bool CanDecompose(Type type) {
     17    public bool CanSerialize(Type type) {
    1818      return type == typeof(Type) ||
    1919             type.VersionInvariantName() == "System.RuntimeType, mscorlib";
Note: See TracChangeset for help on using the changeset viewer.