| | 1 | | using Newtonsoft.Json.Linq; |
| | 2 | | using ValidateLib.ErrorsAndWarnings.Warnings; |
| | 3 | | using ValidateLib.Metadata.Parsers; |
| | 4 | | using ValidateLib.Metadata.Properties; |
| | 5 | | using ValidateLib.Metadata.PropertyParsers; |
| | 6 | |
|
| | 7 | | namespace ValidateLib.Metadata.Descriptors |
| | 8 | | { |
| | 9 | | public class CommonPropertiesDescriptor : ContextDescriptor, Interfaces.IParsable<CommonPropertiesDescriptor> |
| | 10 | | { |
| 1 | 11 | | public List<CommonProperty> commonProperties = new List<CommonProperty>(); |
| | 12 | |
|
| 0 | 13 | | public void AddProperty(CommonProperty property) => commonProperties.Add(property); |
| | 14 | | new static List<Warning> NormalizeProperty(JProperty property, Context context) |
| | 15 | | { |
| 0 | 16 | | return ContextDescriptor.NormalizeProperty(property, context); |
| | 17 | | } |
| | 18 | |
|
| | 19 | | new public IPropertyParserBase? GetPropertyParser(JProperty property, List<Warning> warnings) |
| | 20 | | { |
| 1 | 21 | | string propertyName = property.Name; |
| 1 | 22 | | if (CommonProperty.IsCommonProperty(propertyName)) { return new CommonPropertyParser(warnings, this); } |
| 0 | 23 | | else return ((ContextDescriptor)this).GetPropertyParser(property, warnings); |
| | 24 | | } |
| | 25 | |
|
| | 26 | | public static IParser<CommonPropertiesDescriptor> GetParser(List<Warning> warnings, CommonPropertiesDescriptor? |
| | 27 | | { |
| 0 | 28 | | throw new NotImplementedException(); |
| | 29 | | } |
| | 30 | | } |
| | 31 | | } |