Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 18030 was 17843, checked in by dpiringe, 4 years ago

#3026

  • removed property ConvertableType from all converters
  • removed the option to fixate or loosen the path of JsonItems (obsolete)
  • added a abstract formatter SymbolicRegressionSolutionFormatterBase as base formatter for ISymbolicRegressionSolution
  • unified the construction of exporter controls
  • code cleanup
File size: 2.1 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    /// <summary>
14    /// Only active items are included in templates.
15    /// </summary>
16    bool Active { get; set; }
17
18    /// <summary>
19    /// The name of the JsonItem. Can be changed freely after fixating the path.
20    /// If the path is not fix, changing the name will have affect of the path.
21    /// </summary>
22    string Name { get; set; }
23
24    /// <summary>
25    /// A description for the JsonItem.
26    /// </summary>
27    string Description { get; set; }
28
29    /// <summary>
30    /// The JsonItem path in the related object graph.
31    /// </summary>
32    string Path { get; }
33
34    /// <summary>
35    /// IEnumerable of all sub JsonItems.
36    /// </summary>
37    [JsonIgnore]
38    IEnumerable<IJsonItem> Children { get; }
39
40    /// <summary>
41    /// If the JsonItem is a children of an other JsonItem, the parent will be this other JsonItem.
42    /// </summary>
43    [JsonIgnore]
44    IJsonItem Parent { get; set; }
45
46    /// <summary>
47    /// Returns a validator with integrated caching to validate the JsonItem and all children.
48    /// </summary>
49    /// <returns>JsonItemValidator</returns>   
50    IJsonItemValidator GetValidator();
51
52    /// <summary>
53    /// Add sub JsonItems.
54    /// </summary>
55    /// <param name="childs"></param>
56    void AddChildren(params IJsonItem[] childs);
57    void AddChildren(IEnumerable<IJsonItem> childs);
58
59    /// <summary>
60    /// Method to generate a Newtonsoft JObject, which describes the JsonItem.
61    /// </summary>
62    /// <returns>Newtonsoft JObject</returns>
63    JObject GenerateJObject();
64
65    /// <summary>
66    /// To set all necessary JsonItem properties with an given Newtonsoft JObject.
67    /// </summary>
68    /// <param name="jObject">Newtonsoft JObject</param>
69    void SetJObject(JObject jObject);
70  }
71}
Note: See TracBrowser for help on using the repository browser.