Free cookie consent management tool by TermsFeed Policy Generator

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

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

#3026:

  • refactored json item validation process -> every method now returns a ValidationResult containing bool Success (true if validation is successful) and IEnumerable<string> Errors (error messages)
    • this design allows to specify error messages directly in json items
File size: 1.0 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
[17433]15    public override string Description {
16      get => throw new NotSupportedException();
17      set => throw new NotSupportedException();
18    }
19
[17394]20    public override string Path {
21      get => throw new NotSupportedException();
22    }
23
24    [JsonIgnore]
[17406]25    public override IList<IJsonItem> Children {
[17394]26      get => throw new NotSupportedException();
27      protected set => throw new NotSupportedException();
28    }
29
30    [JsonIgnore]
[17406]31    public override IJsonItem Parent {
[17394]32      get => throw new NotSupportedException();
33      set => throw new NotSupportedException();
34    }
35
[17481]36    protected override ValidationResult Validate() => ValidationResult.Successful();
[17394]37  }
38}
Note: See TracBrowser for help on using the repository browser.