| | | 1 | | using Newtonsoft.Json.Linq; |
| | | 2 | | using ValidateLib.ErrorsAndWarnings.Warnings; |
| | | 3 | | using ValidateLib.Metadata.Parsers; |
| | | 4 | | using ValidateLib.Metadata.PropertyParsers; |
| | | 5 | | using ValidateLib.Metadata.PropertyParsers.Context; |
| | | 6 | | |
| | | 7 | | namespace ValidateLib.Metadata.Descriptors |
| | | 8 | | { |
| | | 9 | | public class ContextDescriptor : Descriptor, Interfaces.IParsable<ContextDescriptor> |
| | | 10 | | { |
| | 1 | 11 | | public Context? context { get; set; } |
| | | 12 | | |
| | | 13 | | new public static List<Warning> NormalizeProperty(JProperty property, Context context) |
| | | 14 | | { |
| | 1 | 15 | | List<Warning> warnings = new List<Warning>(); |
| | 1 | 16 | | switch (property.Name) |
| | | 17 | | { |
| | | 18 | | case "@context": |
| | 1 | 19 | | return warnings; |
| | | 20 | | default: |
| | 1 | 21 | | return Descriptor.NormalizeProperty(property, context); |
| | | 22 | | |
| | | 23 | | } |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | public static IParser<ContextDescriptor> GetParser(List<Warning> warnings, ContextDescriptor? descriptor = null) |
| | | 27 | | { |
| | 0 | 28 | | throw new NotImplementedException(); |
| | | 29 | | } |
| | | 30 | | |
| | | 31 | | new public IPropertyParserBase? GetPropertyParser(JProperty property, List<Warning> warnings) |
| | | 32 | | { |
| | 1 | 33 | | string propertyName = property.Name; |
| | | 34 | | switch (propertyName) |
| | | 35 | | { |
| | | 36 | | case "@context": |
| | 0 | 37 | | return new ContextPropertyParser(warnings, this); |
| | | 38 | | default: |
| | 1 | 39 | | return ((Descriptor)this).GetPropertyParser(property, warnings); |
| | | 40 | | |
| | | 41 | | } |
| | | 42 | | } |
| | | 43 | | } |
| | | 44 | | } |