Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 18043 was 18043, checked in by dpiringe, 3 years ago

#3026

  • code cleanup
File size: 2.0 KB
Line 
1using System.Collections.Generic;
2using Newtonsoft.Json;
3using Newtonsoft.Json.Linq;
4
5namespace HeuristicLab.JsonInterface {
6  [JsonObject]
7  public interface IJsonItem : IEnumerable<IJsonItem> {
8    /// <summary>
9    /// Only active items are included in templates.
10    /// </summary>
11    bool Active { get; set; }
12
13    /// <summary>
14    /// The name of the JsonItem. Can be changed freely after fixating the path.
15    /// If the path is not fix, changing the name will have affect of the path.
16    /// </summary>
17    string Name { get; set; }
18
19    /// <summary>
20    /// A description for the JsonItem.
21    /// </summary>
22    string Description { get; set; }
23
24    /// <summary>
25    /// The JsonItem path in the related object graph.
26    /// </summary>
27    string Path { get; }
28
29    /// <summary>
30    /// IEnumerable of all sub JsonItems.
31    /// </summary>
32    [JsonIgnore]
33    IEnumerable<IJsonItem> Children { get; }
34
35    /// <summary>
36    /// If the JsonItem is a children of an other JsonItem, the parent will be this other JsonItem.
37    /// </summary>
38    [JsonIgnore]
39    IJsonItem Parent { get; set; }
40
41    /// <summary>
42    /// Returns a validator with integrated caching to validate the JsonItem and all children.
43    /// </summary>
44    /// <returns>JsonItemValidator</returns>   
45    IJsonItemValidator GetValidator();
46
47    /// <summary>
48    /// Add sub JsonItems.
49    /// </summary>
50    /// <param name="childs"></param>
51    void AddChildren(params IJsonItem[] childs);
52    void AddChildren(IEnumerable<IJsonItem> childs);
53
54    /// <summary>
55    /// Method to generate a Newtonsoft JObject, which describes the JsonItem.
56    /// </summary>
57    /// <returns>Newtonsoft JObject</returns>
58    JObject GenerateJObject();
59
60    /// <summary>
61    /// To set all necessary JsonItem properties with an given Newtonsoft JObject.
62    /// </summary>
63    /// <param name="jObject">Newtonsoft JObject</param>
64    void SetJObject(JObject jObject);
65  }
66}
Note: See TracBrowser for help on using the repository browser.