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
|
Rev | Line | |
---|
[17406] | 1 | using System;
|
---|
[17477] | 2 | using System.Collections;
|
---|
[17406] | 3 | using System.Collections.Generic;
|
---|
| 4 | using System.Linq;
|
---|
| 5 | using System.Text;
|
---|
| 6 | using System.Threading.Tasks;
|
---|
| 7 | using Newtonsoft.Json;
|
---|
[17446] | 8 | using Newtonsoft.Json.Linq;
|
---|
[17406] | 9 |
|
---|
| 10 | namespace HeuristicLab.JsonInterface {
|
---|
[17477] | 11 | [JsonObject]
|
---|
| 12 | public interface IJsonItem : IEnumerable<IJsonItem> {
|
---|
[17451] | 13 | bool Active { get; set; }
|
---|
[17406] | 14 | string Name { get; set; }
|
---|
| 15 |
|
---|
[17433] | 16 | string Description { get; set; }
|
---|
| 17 |
|
---|
[17406] | 18 | string Path {
|
---|
| 19 | get;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | [JsonIgnore]
|
---|
[17420] | 23 | IList<IJsonItem> Children { get; } //TODO: IEnumerable
|
---|
[17406] | 24 |
|
---|
| 25 | [JsonIgnore]
|
---|
| 26 | IJsonItem Parent { get; set; }
|
---|
[17477] | 27 |
|
---|
[17406] | 28 | IJsonItemValidator GetValidator();
|
---|
| 29 |
|
---|
[17420] | 30 | void AddChildren(params IJsonItem[] childs);
|
---|
[17406] | 31 |
|
---|
[17420] | 32 | void AddChildren(IEnumerable<IJsonItem> childs);
|
---|
[17444] | 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();
|
---|
[17446] | 45 |
|
---|
[17477] | 46 | JObject GenerateJObject();
|
---|
| 47 | void SetJObject(JObject jObject);
|
---|
[17406] | 48 | }
|
---|
| 49 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.