Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItem.cs @ 17511

Last change on this file since 17511 was 17477, checked in by dpiringe, 5 years ago

#3026:

  • refactored JsonTemplateInstantiator -> now returns a InstantiatorResult which contains the optimizer and an IEnumerable of IResultJsonItem
  • code cleanup in JCGenerator
  • relocated the serialization of json items into IJsonItem with method GenerateJObject (virtual base implementation in JsonItem)
    • this allows custom serialization for json items (example: ValueLookupJsonItem)
    • items of interface IIntervalRestrictedJsonItem have a custom implementation of GenerateJObject -> hides Minimum and Maximum if the values are the physically min/max of their type
  • code cleanup in BaseConverter
File size: 1.2 KB
Line 
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7using Newtonsoft.Json;
8using Newtonsoft.Json.Linq;
9
10namespace HeuristicLab.JsonInterface {
11  [JsonObject]
12  public interface IJsonItem : IEnumerable<IJsonItem> {
13    bool Active { get; set; }
14    string Name { get; set; }
15
16    string Description { get; set; }
17
18    string Path {
19      get;
20    }
21
22    [JsonIgnore]
23    IList<IJsonItem> Children { get; } //TODO: IEnumerable
24
25    [JsonIgnore]
26    IJsonItem Parent { get; set; }
27       
28    IJsonItemValidator GetValidator();
29
30    void AddChildren(params IJsonItem[] childs);
31
32    void AddChildren(IEnumerable<IJsonItem> childs);
33
34    /// <summary>
35    /// This method fixates the path.
36    /// After calling, the path cannot be changed by changing the name or parent.
37    /// </summary>
38    void FixatePath();
39
40    /// <summary>
41    /// This method looses the path again after a call of FixatePath.
42    /// After calling, the path is calculated by the position in item tree again.
43    /// </summary>
44    void LoosenPath();
45
46    JObject GenerateJObject();
47    void SetJObject(JObject jObject);
48  }
49}
Note: See TracBrowser for help on using the repository browser.