Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/09 13:30:58 (15 years ago)
Author:
epitzer
Message:

Split all classes into their own file (#506)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs

    r1360 r1361  
    4545        yield return iterator.Current;     
    4646    }
    47 
    4847   
    4948    private IEnumerator<ISerializationToken> Serialize(DataMemberAccessor accessor) {
    5049      object value = accessor.Get();
    5150      if (value == null)
    52         return NullReferenceEnumeration(accessor.Name);
     51        return NullReferenceEnumerator(accessor.Name);
    5352      if (obj2id.ContainsKey(value))
    54         return ReferenceTokenEnumeration(accessor.Name, obj2id[value]);             
     53        return ReferenceEnumerator(accessor.Name, obj2id[value]);             
    5554      if ( ! typeCache.ContainsKey(value.GetType()))
    5655        typeCache.Add(value.GetType(), typeCache.Count);
     
    6362      IFormatter formatter = configuration.GetFormatter(value.GetType());
    6463      if (formatter != null)
    65         return PrimitiveEnumeration(accessor.Name, typeId, formatter.DoFormat(value), id);
     64        return PrimitiveEnumerator(accessor.Name, typeId, formatter.DoFormat(value), id);
    6665      IDecomposer decomposer = configuration.GetDecomposer(value.GetType());
    6766      if (decomposer != null)
    68         return CompositeEnumeration(accessor.Name, decomposer.DeCompose(value), id, typeId);           
    69       return StorableEnumeration(accessor.Name, value, id, typeId);
     67        return CompositeEnumerator(accessor.Name, decomposer.DeCompose(value), id, typeId);           
     68      return StorableEnumerator(accessor.Name, value, id, typeId);
    7069    }
    7170
    72     private IEnumerator<ISerializationToken> NullReferenceEnumeration(string name) {
     71    private IEnumerator<ISerializationToken> NullReferenceEnumerator(string name) {
    7372      yield return new NullReferenceToken(name);
    7473    }
    7574
    76     private IEnumerator<ISerializationToken> ReferenceTokenEnumeration(string name, int id) {
     75    private IEnumerator<ISerializationToken> ReferenceEnumerator(string name, int id) {
    7776      yield return new ReferenceToken(name, id);
    7877    }
    7978
    80     private IEnumerator<ISerializationToken> PrimitiveEnumeration(string name, int typeId, object serializedValue, int? id) {
     79    private IEnumerator<ISerializationToken> PrimitiveEnumerator(string name,
     80        int typeId, object serializedValue, int? id) {
    8181      yield return new PrimitiveToken(name, typeId, serializedValue, id);
    8282    }
    8383
    84     private IEnumerator<ISerializationToken> CompositeEnumeration(string name, IEnumerable values, int? id, int typeId) {
     84    private IEnumerator<ISerializationToken> CompositeEnumerator(string name,
     85        IEnumerable values, int? id, int typeId) {
    8586      yield return new BeginToken(name, typeId, id);     
    8687        foreach (object o in values) {
     
    9293    }
    9394
    94     private IEnumerator<ISerializationToken> StorableEnumeration(string name, object value, int? id, int typeId) {           
     95    private IEnumerator<ISerializationToken> StorableEnumerator(string name,
     96        object value, int? id, int typeId) {           
    9597      yield return new BeginToken(name, typeId, id);
    9698      int nSubComponents = 0;
    9799      foreach (KeyValuePair<string, DataMemberAccessor> mapping in
    98100        StorableAttribute.GetAutostorableAccessors(value)) {
    99         nSubComponents += 1;
     101        nSubComponents += 1;               
    100102        IEnumerator<ISerializationToken> iterator = Serialize(mapping.Value);
    101103        while (iterator.MoveNext()) {
     
    104106      }
    105107      if (nSubComponents == 0) {
    106         throw new ApplicationException(String.Format(
    107                                          "Composite value of type \"{0}\" contains no subcomponents",
    108                                          value.GetType().FullName));
     108        throw new ApplicationException(
     109          String.Format(
     110            "CustomComposite value of type \"{0}\" contains no subcomponents",
     111            value.GetType().FullName));
    109112      }
    110113      yield return new EndToken(name, typeId, id);
Note: See TracChangeset for help on using the changeset viewer.