| | 1 | | using Newtonsoft.Json.Linq; |
| | 2 | | using ValidateLib.ErrorsAndWarnings.Warnings; |
| | 3 | | using ValidateLib.Metadata.Descriptors; |
| | 4 | | using ValidateLib.Metadata.Parsers; |
| | 5 | | using ValidateLib.Metadata.Validators; |
| | 6 | |
|
| | 7 | | namespace ValidateLib.Metadata.PropertyParsers.Schema |
| | 8 | | { |
| | 9 | | public class ColumnsPropertyParser : PropertyParserBase<SchemaDescriptor>, IPropertyParser<SchemaDescriptor> |
| | 10 | | { |
| 1 | 11 | | public ColumnsPropertyParser(List<Warning> warnings, SchemaDescriptor descriptor) : base(warnings, descriptor) |
| | 12 | | { |
| 1 | 13 | | } |
| | 14 | |
|
| | 15 | | public void ParseProperty(JProperty property) |
| | 16 | | { |
| 1 | 17 | | var arrrayProeprtyParser = new ArrayPropertyParser<ColumnDescriptor>(Warnings); |
| 1 | 18 | | var columnsProperty = arrrayProeprtyParser.ParseJToken(property); |
| 1 | 19 | | Descriptor.columns = columnsProperty; |
| 1 | 20 | | var columnNamesValidator = new ColumnNamesValidator(); |
| 1 | 21 | | var virtualColumnsValidator = new VirtualColumnsValidator(); |
| 1 | 22 | | Warnings.AddRange(columnNamesValidator.Validate(Descriptor)); |
| 1 | 23 | | Warnings.AddRange(virtualColumnsValidator.Validate(Descriptor)); |
| | 24 | |
|
| 1 | 25 | | } |
| | 26 | |
|
| | 27 | | } |
| | 28 | | } |