Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/UnsupportedJsonItem.cs @ 17399

Last change on this file since 17399 was 17394, checked in by dpiringe, 5 years ago

#3026:

  • deleted: ConvertableAttribute, DummyConverter, ObjectExtensions
  • renamed: CustomJsonWriter -> SingleLineArrayJsonWriter, JCInstantiator -> JsonTemplateInstantiator
  • added: JsonItemConverterFactory, UnsupportedJsonItem
  • IJsonItemConverter:
    • added two new properties: Priority and ConvertableType -> because converters are automatically collected by plugin infrastructure now
    • Extract, Inject references a root converter now -> typically an instance of JsonItemConverter -> to prevent cycles
  • JsonItemConverter:
    • now implements the interface IJsonItemConverter
    • is now a dynamic class
    • is only instantiable with an factory (JsonItemConverterFactory)
    • still has the old (but now public) static methods Extract and Inject (without ref param IJsonItemConverter root) -> creates instance with factory and calls methods of instance
    • removed register and unregister methods, because the factory collects all converters automatically now (on first call of Create)
    • has cycle detection for Extract and Inject
    • renamed method Get to GetConverter
File size: 1.2 KB
RevLine 
[17394]1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using Newtonsoft.Json;
7
8namespace HeuristicLab.JsonInterface {
9  public class UnsupportedJsonItem : JsonItem {
10    public override string Name {
11      get => throw new NotSupportedException();
12      set => throw new NotSupportedException();
13    }
14
15    public override string Path {
16      get => throw new NotSupportedException();
17    }
18
19    [JsonIgnore]
20    public override IList<JsonItem> Children {
21      get => throw new NotSupportedException();
22      protected set => throw new NotSupportedException();
23    }
24
25    [JsonIgnore]
26    public override JsonItem Parent {
27      get => throw new NotSupportedException();
28      set => throw new NotSupportedException();
29    }
30
31    public override object Value {
32      get => throw new NotSupportedException();
33      set => throw new NotSupportedException();
34    }
35
36    public override IEnumerable<object> Range {
37      get => throw new NotSupportedException();
38      set => throw new NotSupportedException();
39    }
40
41    public override string ActualName {
42      get => throw new NotSupportedException();
43      set => throw new NotSupportedException();
44    }
45  }
46}
Note: See TracBrowser for help on using the repository browser.